/* ============================================
   SMA Admin Login — Restaurant Theme
   ألوان النظام: #428bca | #78cd51 | #282b2e
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.restaurant-login {
    margin: 0;
    min-height: 100vh;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
    background: #121416;
    background-image:
        radial-gradient(ellipse 80% 60% at 85% 15%, rgba(66, 139, 202, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 10% 90%, rgba(120, 205, 81, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 160, 60, 0.06) 0%, transparent 60%),
        linear-gradient(160deg, #0d0f11 0%, #1a1d21 45%, #25282c 100%);
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    color: #2c3e50;
}

body.restaurant-login::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
}

/* Shell */
.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-wrapper {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: loginFadeIn 0.6s ease-out;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Brand panel */
.login-brand {
    background: linear-gradient(145deg, #1e2124 0%, #282b2e 50%, #32363b 100%);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    border-left: 4px solid #428bca;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #428bca, #78cd51);
}

.login-brand-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 24px;
    filter: none;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.login-brand-title {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.35;
}

.login-brand-tagline {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin: 0 0 32px;
    line-height: 1.6;
}

.login-brand-features {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 260px;
}

.login-brand-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-brand-features li:last-child {
    border-bottom: none;
}

.login-brand-features li i {
    color: #78cd51;
    font-size: 14px;
    width: 20px;
    text-align: center;
}

/* Form panel */
.login-form-panel {
    background: #fff;
    padding: 44px 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-header {
    margin-bottom: 28px;
}

.login-form-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1d21;
}

.login-form-header p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

/* Alerts */
.login-form-panel .alert {
    border-radius: 10px;
    border: none;
    font-size: 13px;
    margin-bottom: 20px;
}

/* Form fields */
.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #40454a;
    margin-bottom: 7px;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.login-input-wrap .field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #428bca;
    font-size: 15px;
    pointer-events: none;
    z-index: 2;
}

.login-input-wrap input.form-control {
    width: 100%;
    height: 46px;
    padding: 10px 44px 10px 14px;
    border: 1.5px solid #dee2e6;
    border-radius: 10px !important;
    font-family: inherit;
    font-size: 14px;
    color: #2c3e50;
    background: #f8f9fa;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-input-wrap input.form-control:focus {
    border-color: #428bca;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(66, 139, 202, 0.15);
    outline: none;
}

.login-input-wrap input.form-control::placeholder {
    color: #adb5bd;
}

/* Captcha row */
.login-captcha-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.login-captcha-row .captcha-img-wrap {
    flex: 0 0 130px;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid #dee2e6;
    background: #f8f9fa;
}

.login-captcha-row .captcha-img-wrap img {
    width: 100%;
    height: 46px;
    object-fit: cover;
    display: block;
}

.login-captcha-row .login-input-wrap {
    flex: 1;
}

/* Remember + submit row */
.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    margin-bottom: 4px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #40454a;
    margin: 0;
    user-select: none;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #428bca;
    cursor: pointer;
    margin: 0;
}

.login-submit {
    width: 100%;
    height: 48px;
    margin-top: 20px;
    border: none;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #428bca 0%, #357abd 100%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 4px 14px rgba(66, 139, 202, 0.35);
    letter-spacing: 0.02em;
}

.login-submit:hover,
.login-submit:focus {
    background: linear-gradient(135deg, #357abd 0%, #2a6496 100%);
    box-shadow: 0 6px 20px rgba(66, 139, 202, 0.45);
    transform: translateY(-1px);
    color: #fff;
    outline: none;
}

.login-submit:active {
    transform: translateY(0);
}

/* Forgot password link */
.login-forgot-link {
    display: inline-block;
    margin-top: 18px;
    font-size: 13px;
    color: #428bca;
    text-decoration: none;
    transition: color 0.2s;
}

.login-forgot-link:hover {
    color: #2a6496;
    text-decoration: underline;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eef0f2;
    font-size: 12px;
    color: #adb5bd;
}

.login-footer a {
    color: #428bca;
    text-decoration: none;
}

/* Panels container */
.login-panels {
    display: flex;
    flex-direction: column;
    background: #fff;
}

.login-panels > .login-form-panel {
    flex: 1;
}

/* Captcha reload */
.captcha-input-wrap {
    position: relative;
}

.captcha-reload {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #428bca;
    font-size: 14px;
    z-index: 3;
    text-decoration: none;
    padding: 4px;
}

.captcha-input-wrap input.form-control {
    padding-right: 38px;
}

.captcha-image img {
    width: 100%;
    height: 46px;
    object-fit: cover;
    display: block;
}

/* Links below form */
.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-links-text {
    margin: 0 0 8px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
}

.login-links-text a {
    color: #428bca;
    font-weight: 600;
    text-decoration: none;
}

.login-links-text a:hover {
    text-decoration: underline;
    color: #2a6496;
}

/* Register grid */
.login-register-panel {
    overflow-y: auto;
    max-height: 90vh;
}

.login-register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.login-hint {
    display: block;
    font-size: 11px;
    color: #adb5bd;
    margin-top: 4px;
}

/* Back link */
.login-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #428bca;
    cursor: pointer;
    margin-bottom: 16px;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.login-back-link:hover {
    color: #2a6496;
}

/* Forgot password panel (same page toggle) */
.login-forgot-panel {
    display: none;
}

.login-forgot-panel.active {
    display: block;
}

.login-form-panel.hidden {
    display: none;
}

/* Validation errors */
.login-field .help-block,
.login-field .text-danger {
    font-size: 12px;
    margin-top: 5px;
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .login-brand {
        padding: 32px 28px 28px;
        border-left: none;
        border-top: 4px solid #428bca;
    }

    .login-brand-logo {
        width: 90px;
        height: 90px;
        margin-bottom: 16px;
    }

    .login-brand-title {
        font-size: 22px;
    }

    .login-brand-features {
        display: none;
    }

    .login-form-panel {
        padding: 32px 28px 28px;
    }
}

@media (max-width: 400px) {
    .login-shell {
        padding: 12px 10px;
    }

    .login-wrapper {
        border-radius: 14px;
    }

    .login-captcha-row {
        flex-direction: column;
    }

    .login-captcha-row .captcha-img-wrap {
        flex: none;
    }

    .login-register-grid {
        grid-template-columns: 1fr;
    }
}
