/**
 * Amber Group — login / OTP / register
 * Visual tokens match the public website (amber-home.css navy/gold).
 */

:root {
    --home-navy: #071428;
    --home-navy-deep: #05101f;
    --home-gold: #d4af37;
    --home-gold-soft: #f3d27a;
    --home-ink: #e8eef8;
    --home-muted: #b7c3d6;

    --bg-primary: #071428;
    --bg-secondary: #05101f;
    --bg-card: rgba(10, 22, 44, 0.72);
    --bg-overlay: rgba(5, 16, 32, 0.72);

    --amber: #d4af37;
    --amber-light: #f3d27a;
    --amber-dark: #b8941f;
    --gold: #d4af37;
    --gold-light: #f6e27a;

    --text-primary: #e8eef8;
    --text-secondary: #b7c3d6;
    --text-muted: #8fa0b8;

    --border-color: rgba(243, 210, 122, 0.28);
    --border-hover: rgba(212, 175, 55, 0.7);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.28);
    --shadow-amber: 0 0 20px rgba(212, 175, 55, 0.22);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Cairo", "Inter", system-ui, sans-serif;
    background: var(--home-navy);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 12% 8%, rgba(212, 175, 55, 0.12), transparent 42%),
        radial-gradient(ellipse at 88% 92%, rgba(36, 82, 150, 0.22), transparent 46%),
        linear-gradient(180deg, #071428 0%, #05101f 100%);
    z-index: 0;
    pointer-events: none;
}

.lang-switcher {
    position: fixed;
    top: 24px;
    z-index: 1000;
}

body[dir="rtl"] .lang-switcher {
    left: 24px;
}

body[dir="ltr"] .lang-switcher {
    right: 24px;
}

.lang-switcher a {
    color: var(--home-gold-soft);
    text-decoration: none;
    background: rgba(7, 20, 40, 0.72);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.7);
    display: inline-flex;
    align-items: center;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lang-switcher .lang-switch-inner {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    line-height: 1;
}

.lang-switcher .lang-flag {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.lang-switcher .lang-name {
    font-size: 13px;
    font-weight: 600;
}

.lang-switcher a:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--amber);
    color: var(--home-gold-soft);
}

.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-page-stack {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 16px 40px;
    box-sizing: border-box;
}

.auth-top-header {
    text-align: center;
    padding: 12px 16px 8px;
    border-bottom: none;
    margin-bottom: 12px;
}

.auth-top-header .logo-container {
    margin-bottom: 12px;
}

.auth-top-header .logo-img {
    max-height: 128px;
    width: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.auth-welcome-ar {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--home-gold-soft);
    margin-bottom: 8px;
    line-height: 1.4;
}

.auth-welcome-en {
    font-size: 1.1rem;
    color: var(--home-gold-soft);
}

.auth-login-wrap {
    margin-bottom: 0;
}

.auth-login-wrap .login-container {
    max-width: 420px;
    margin: 0 auto;
}

.landing-section {
    padding: 80px 24px 60px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.landing-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.logo-container {
    text-align: center;
    margin-bottom: 8px;
}

.logo-img {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    transition: var(--transition);
}

.logo-img:hover {
    filter: drop-shadow(0 6px 20px rgba(212, 175, 55, 0.35));
}

.company-heading {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.company-subtitle {
    font-size: 16px;
    text-align: center;
    color: var(--home-gold-soft);
    font-weight: 400;
    letter-spacing: 1px;
    margin-bottom: 32px;
}

.content-block,
.login-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    color: var(--home-ink);
}

.content-block:hover,
.login-card:hover {
    border-color: var(--border-hover);
}

.block-title {
    font-size: 24px;
    font-weight: 700;
    color: #f6e27a;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.block-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 400;
}

.block-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.services-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.services-list li {
    font-size: 15px;
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.services-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--amber);
    font-weight: 600;
}

body[dir="rtl"] .services-list li {
    padding-left: 0;
    padding-right: 24px;
}

body[dir="rtl"] .services-list li::before {
    left: auto;
    right: 0;
}

.values-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.value-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 13px;
    color: var(--amber-light);
    font-weight: 500;
    transition: var(--transition-fast);
}

.value-badge:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--amber);
}

.contact-block {
    margin-top: 8px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--home-gold-soft);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(5, 16, 32, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit,
.btn-login {
    padding: 14px 32px;
    background: linear-gradient(180deg, #e6c96a 0%, #c9a227 100%);
    border: 1px solid #b8941f;
    border-radius: 999px;
    color: #1a1408;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    font-family: inherit;
}

.btn-submit:hover,
.btn-login:hover {
    background: linear-gradient(180deg, #f0d57a 0%, #d4af37 100%);
}

.btn-submit:active,
.btn-login:active {
    transform: none;
}

.btn-submit {
    align-self: flex-start;
}

.login-section {
    padding: 60px 24px;
    background: transparent;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.login-container {
    max-width: 480px;
    margin: 0 auto;
}

.login-card {
    padding: 40px 32px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: #f6e27a;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.login-subtitle {
    font-size: 14px;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
}

.login-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: rgba(5, 16, 32, 0.55);
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.toggle-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.toggle-btn.active {
    background: linear-gradient(180deg, #e6c96a 0%, #c9a227 100%);
    color: #1a1408;
    box-shadow: var(--shadow-sm);
}

.toggle-btn:not(.active):hover {
    color: var(--home-gold-soft);
    background: rgba(212, 175, 55, 0.1);
}

.login-form {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.login-form.active {
    display: flex;
}

.login-form:not(.active) {
    display: none;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--home-gold-soft);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(5, 16, 32, 0.55);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
}

.login-form input::placeholder {
    color: var(--text-muted);
}

.login-form input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    background: rgba(5, 16, 32, 0.72);
}

.btn-login {
    width: 100%;
    margin-top: 8px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
}

.error-box {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.error-item {
    font-size: 13px;
    color: #ffb3b3;
    margin-bottom: 4px;
}

.error-item:last-child {
    margin-bottom: 0;
}

.role-info {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.role-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.role-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.role-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
}

.role-badge.admin {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--amber);
    color: var(--amber-light);
}

.role-badge.employee {
    background: rgba(0, 200, 255, 0.15);
    border-color: rgba(0, 200, 255, 0.4);
    color: #7dd3fc;
}

.role-badge.visitor {
    background: rgba(128, 128, 128, 0.15);
    border-color: rgba(128, 128, 128, 0.4);
    color: #d3d3d3;
}

.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
    text-align: center;
    font-size: 12px;
    color: rgba(232, 238, 248, 0.72);
}

@media (max-width: 768px) {
    .landing-section {
        padding: 60px 16px 40px;
    }

    .content-block {
        padding: 24px;
    }

    .block-title {
        font-size: 20px;
    }

    .company-heading {
        font-size: 24px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .login-title {
        font-size: 24px;
    }

    .toggle-btn {
        font-size: 12px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .logo-img {
        width: 100px;
    }

    .company-heading {
        font-size: 20px;
    }

    .company-subtitle {
        font-size: 14px;
    }

    .content-block {
        padding: 20px;
    }

    .login-card {
        padding: 24px 20px;
    }
}

body[dir="rtl"] {
    direction: rtl;
}

body[dir="ltr"] {
    direction: ltr;
}

@media (prefers-reduced-motion: no-preference) {
    * {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
