:root {
    --nama-auth-blue: #062a4c;
    --nama-auth-blue-dark: #031c35;
    --nama-auth-blue-light: #087f91;
    --nama-auth-gold: #d4af37;
    --nama-auth-gold-light: #f2d16b;
    --nama-auth-silver: #c9cdd2;
    --nama-auth-silver-light: #f3f5f7;
    --nama-auth-text: #10283e;
    --nama-auth-muted: #6f7d89;
    --nama-auth-danger: #c74656;
    --nama-auth-success: #198754;
    --nama-card-background: linear-gradient(180deg, #038191 0%, #fafbfc 80%);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

[data-theme="dark"] {
    --nama-card-background: #202b3c;
}

.nama-auth-body {
    min-height: 100vh;
    background: radial-gradient(circle at 15% 20%, rgba(212, 175, 55, 0.16), transparent 30%), linear-gradient(135deg, var(--nama-auth-blue-dark), var(--nama-auth-blue));
    color: var(--nama-auth-text);
    font-family: "Cairo", "Tajawal", Arial, sans-serif;
}

.nama-auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
}

.nama-auth-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 50px;
    border-left: 1px solid rgba(212, 175, 55, 0.5);
    color: #ffffff;
}

.nama-auth-brand-panel::before,
.nama-auth-brand-panel::after {
    position: absolute;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 50%;
    content: "";
}

.nama-auth-brand-panel::before {
    width: 520px;
    height: 520px;
    top: -180px;
    right: -170px;
}

.nama-auth-brand-panel::after {
    width: 360px;
    height: 360px;
    bottom: -130px;
    left: -120px;
}

.nama-auth-brand-content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    text-align: center;
}

.nama-auth-logo {
    width: 190px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.25));
}

.nama-auth-brand-content h1 {
    margin: 10px 0 4px;
    color: var(--nama-auth-gold-light);
    font-size: 3rem;
    font-weight: 800;
}

.nama-auth-brand-content p {
    margin: 0 0 35px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
}

.nama-auth-features {
    display: grid;
    gap: 14px;
    text-align: right;
}

.nama-auth-features span {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.05);
}

.nama-auth-features i {
    width: 24px;
    color: var(--nama-auth-gold-light);
    text-align: center;
}

.nama-auth-content-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 45px;
    background: linear-gradient(145deg, #ffffff, var(--nama-auth-silver-light));
}

.nama-auth-card {
    width: min(560px, 100%);
    padding: 36px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(3, 28, 53, 0.16);
}

.nama-auth-header {
    margin-bottom: 25px;
    text-align: center;
}

.nama-auth-header-icon {
    display: flex;
    width: 66px;
    height: 66px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border-radius: 20px;
    background: linear-gradient(145deg, var(--nama-auth-gold-light), var(--nama-auth-gold));
    color: var(--nama-auth-blue-dark);
    font-size: 1.7rem;
}

.nama-auth-header h2 {
    margin: 0 0 7px;
    color: var(--nama-auth-blue);
    font-size: 1.55rem;
    font-weight: 800;
}

.nama-auth-header p {
    margin: 0;
    color: var(--nama-auth-muted);
    font-size: 0.86rem;
    line-height: 1.8;
}

.nama-auth-group {
    margin-bottom: 16px;
}

.nama-auth-label {
    display: block;
    margin-bottom: 7px;
    color: var(--nama-auth-text);
    font-size: 0.82rem;
    font-weight: 800;
}

.nama-auth-input-wrap {
    position: relative;
}

.nama-auth-input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    color: var(--nama-auth-blue-light);
    transform: translateY(-50%);
}

.nama-auth-input,
.nama-auth-code-input {
    width: 100%;
    min-height: 48px;
    padding: 10px 44px 10px 45px;
    border: 1px solid #d9dee3;
    border-radius: 12px;
    outline: none;
    background: #ffffff;
    color: var(--nama-auth-text);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nama-auth-code-input {
    padding: 10px 16px;
    direction: ltr;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    text-align: center;
}

.nama-auth-input:focus,
.nama-auth-code-input:focus {
    border-color: var(--nama-auth-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}

.nama-auth-password-toggle {
    position: absolute;
    top: 50%;
    left: 10px;
    display: flex;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--nama-auth-muted);
    transform: translateY(-50%);
}

.nama-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.nama-auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nama-auth-muted);
    font-size: 0.78rem;
}

.nama-auth-link {
    color: var(--nama-auth-blue-light);
    font-size: 0.8rem;
    font-weight: 800;
}

.nama-auth-link:hover {
    color: var(--nama-auth-gold);
}

.nama-auth-button {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--nama-auth-blue-light), var(--nama-auth-blue));
    color: #ffffff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    box-shadow: 0 9px 22px rgba(6, 42, 76, 0.18);
}

.nama-auth-button-gold {
    background: linear-gradient(135deg, var(--nama-auth-gold-light), var(--nama-auth-gold));
    color: var(--nama-auth-blue-dark);
}

.nama-auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--nama-auth-muted);
    font-size: 0.74rem;
}

.nama-auth-separator::before,
.nama-auth-separator::after {
    height: 1px;
    flex: 1;
    background: #dde2e6;
    content: "";
}

.nama-auth-note {
    color: var(--nama-auth-muted);
    font-size: 0.76rem;
    line-height: 1.8;
    text-align: center;
}

.nama-auth-message {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 0.78rem;
    line-height: 1.7;
}

.nama-auth-message-danger {
    border: 1px solid rgba(199, 70, 86, 0.25);
    background: rgba(199, 70, 86, 0.08);
    color: var(--nama-auth-danger);
}

.nama-auth-message-success {
    border: 1px solid rgba(25, 135, 84, 0.25);
    background: rgba(25, 135, 84, 0.08);
    color: var(--nama-auth-success);
}

.nama-auth-message-warning {
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.1);
    color: #8a6510;
}

.nama-auth-validation {
    display: block;
    margin-top: 5px;
    color: var(--nama-auth-danger);
    font-size: 0.72rem;
}

.nama-auth-footer {
    margin-top: 20px;
    color: rgba(16, 40, 62, 0.55);
    font-size: 0.72rem;
}

.nama-auth-loading {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 28, 53, 0.65);
    backdrop-filter: blur(6px);
}

.nama-auth-loading-box {
    width: min(360px, 92vw);
    padding: 30px;
    border: 1px solid var(--nama-auth-gold);
    border-radius: 20px;
    background: #ffffff;
    text-align: center;
}

.nama-auth-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    border: 4px solid #e1e5e9;
    border-top-color: var(--nama-auth-gold);
    border-radius: 50%;
    animation: namaAuthSpin 0.8s linear infinite;
}

@keyframes namaAuthSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 980px) {
    .nama-auth-shell {
        grid-template-columns: 1fr;
    }

    .nama-auth-brand-panel {
        min-height: 330px;
        border-left: 0;
        border-bottom: 1px solid rgba(212, 175, 55, 0.5);
    }

    .nama-auth-logo {
        width: 125px;
        height: 120px;
    }

    .nama-auth-brand-content h1 {
        font-size: 2.1rem;
    }

    .nama-auth-features {
        display: none;
    }
}

@media (max-width: 580px) {
    .nama-auth-content-panel {
        padding: 18px;
    }

    .nama-auth-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .nama-auth-brand-panel {
        min-height: 250px;
        padding: 25px;
    }

    .nama-auth-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

.nama-password-policy-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--nama-primary);
    font-size: 0.75rem;
    font-weight: 800;
}

    .nama-password-policy-link:hover {
        color: var(--nama-gold-dark);
    }

.nama-password-policy-modal {
    overflow: hidden;
    border: 1px solid var(--nama-gold);
    border-radius: 20px;
    color: #10283e /*#d67e03*/;
    background: var(--nama-card-background);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.nama-password-policy-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(221, 167, 53, 0.45);
    background: linear-gradient(135deg, var(--nama-primary-darker), var(--nama-primary-deep));
    color: #ffffff;
}

    .nama-password-policy-header h5 {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 0;
        color: #ffffff;
        font-size: 1.05rem;
        font-weight: 800;
    }

        .nama-password-policy-header h5 i {
            color: var(--nama-gold);
        }

    .nama-password-policy-header p {
        margin: 7px 0 0;
        color: rgba(255, 255, 255, 0.68);
        font-size: 0.72rem;
    }

.nama-password-policy-close {
    filter: invert(1);
}

.nama-password-policy-body {
    padding: 22px;
}

.nama-password-policy-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--nama-border);
    border-radius: 13px;
    background: var(--nama-silver-light);
}

    .nama-password-policy-intro > i {
        display: flex;
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        background: linear-gradient(145deg, var(--nama-gold-light), var(--nama-gold));
        color: var(--nama-primary-darker);
        font-size: 1.2rem;
    }

    .nama-password-policy-intro strong,
    .nama-password-policy-intro span {
        display: block;
    }

    .nama-password-policy-intro strong {
        color: var(--nama-text-primary);
        font-size: 0.82rem;
    }

    .nama-password-policy-intro span {
        margin-top: 5px;
        color: var(--nama-text-muted);
        font-size: 0.7rem;
        line-height: 1.7;
    }

.nama-password-policy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
}

.nama-password-policy-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--nama-border);
    border-radius: 12px;
    background: var(--nama-card-background);
}

    .nama-password-policy-item > i {
        display: flex;
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: var(--nama-silver-light);
        color: var(--nama-primary);
    }

    .nama-password-policy-item strong,
    .nama-password-policy-item span {
        display: block;
    }

    .nama-password-policy-item strong {
        color: var(--nama-text-primary);
        font-size: 0.76rem;
    }

    .nama-password-policy-item span {
        margin-top: 4px;
        color: var(--nama-text-muted);
        font-size: 0.67rem;
        line-height: 1.6;
    }

.nama-password-policy-warning {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 15px;
    padding: 13px;
    border: 1px solid rgba(190, 49, 68, 0.28);
    border-radius: 12px;
    background: rgba(190, 49, 68, 0.08);
    color: #be3144;
}

    .nama-password-policy-warning strong,
    .nama-password-policy-warning span {
        display: block;
    }

    .nama-password-policy-warning strong {
        font-size: 0.76rem;
    }

    .nama-password-policy-warning span {
        margin-top: 4px;
        font-size: 0.68rem;
    }

.nama-password-policy-security {
    margin-top: 15px;
    padding: 14px;
    border-right: 4px solid var(--nama-gold);
    border-radius: 10px;
    background: var(--nama-silver-light);
}

    .nama-password-policy-security h6 {
        margin: 0 0 7px;
        color: var(--nama-text-primary);
        font-size: 0.77rem;
        font-weight: 800;
    }

    .nama-password-policy-security p {
        margin: 0;
        color: var(--nama-text-muted);
        font-size: 0.68rem;
        line-height: 1.8;
    }

.nama-password-policy-footer {
    padding: 15px 22px;
    border-top: 1px solid var(--nama-border);
    background: var(--nama-silver-light);
}

@media (max-width: 650px) {
    .nama-password-policy-grid {
        grid-template-columns: 1fr;
    }
}