/**
 * e-Surat Fakultas Teknik - Modern Auth Design System
 * Authentic #FE7700 branding with engineering precision, WCAG AA contrast, and craftsmanship polish.
 */

:root {
    --auth-orange-primary: #FE7700;
    --auth-orange-dark: #C44E00;
    --auth-orange-deep: #A83E00;
    --auth-orange-subtle: #FFF7ED;
    --auth-orange-border: #FFEDD5;
    --auth-orange-ring: rgba(254, 119, 0, 0.22);
    --auth-text-heading: #0F172A;
    --auth-text-body: #334155;
    --auth-text-muted: #64748B;
    --auth-border-color: #E2E8F0;
    --auth-bg-input: #F8FAFC;
    --auth-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* 1. Technical Drafting Grid Background (Fakultas Teknik) */
.auth-tech-bg,
.staff-tech-bg {
    background-color: var(--auth-orange-primary) !important;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1px, transparent 1px) !important;
    background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px !important;
    background-position: center center !important;
    position: relative;
    min-height: 100vh;
}

.auth-tech-bg::before,
.staff-tech-bg::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    background:
        radial-gradient(ellipse at center, rgba(254, 119, 0, 0.05) 0%, rgba(180, 60, 0, 0.45) 100%),
        linear-gradient(to right, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1px, transparent 1px) !important;
    background-size: 100% 100%, 80px 80px, 80px 80px, 16px 16px, 16px 16px !important;
    background-position: center center !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

/* 2. Modern Card Slab */
.auth-tech-card {
    position: relative;
    z-index: 5;
    background: #FFFFFF !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-top: 3px solid var(--auth-orange-primary) !important;
    border-radius: 14px !important;
    box-shadow: var(--auth-card-shadow) !important;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.auth-tech-card .card-body {
    padding: 2.25rem 2.25rem 1.75rem 2.25rem;
}

@media (max-width: 576px) {
    .auth-tech-card .card-body {
        padding: 1.75rem 1.25rem 1.25rem 1.25rem;
    }
}

/* 3. Header Branding */
.auth-brand-logo {
    display: inline-block;
    transition: transform 0.2s ease;
}

.auth-brand-logo:hover {
    transform: scale(1.03);
}

.auth-brand-logo img {
    max-height: 68px;
    width: auto;
    object-fit: contain;
}

.auth-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--auth-text-heading);
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
    text-align: center;
}

.auth-card-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* 4. Form Controls & Inputs */
.form-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: var(--auth-text-body) !important;
    margin-bottom: 0.35rem !important;
    letter-spacing: -0.01em;
}

.auth-input {
    height: 46px !important;
    padding: 10px 14px !important;
    font-size: 0.9375rem !important;
    color: var(--auth-text-heading) !important;
    background-color: var(--auth-bg-input) !important;
    border: 1px solid var(--auth-border-color) !important;
    border-radius: 8px !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.auth-input::placeholder {
    color: #94A3B8;
    font-size: 0.875rem;
}

.auth-input:focus {
    background-color: #FFFFFF !important;
    border-color: var(--auth-orange-primary) !important;
    box-shadow: 0 0 0 3px var(--auth-orange-ring) !important;
    outline: none !important;
}

.auth-input.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FFF !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* 5. Password Input Group */
.input-group-seamless {
    display: flex;
    position: relative;
    width: 100%;
    border-radius: 8px;
    transition: box-shadow 0.15s ease;
}

.input-group-seamless .auth-input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
    flex: 1 1 auto;
}

.input-group-seamless .btn-toggle-eye {
    height: 46px;
    padding: 0 14px;
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border-color);
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: #64748B;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.input-group-seamless:focus-within:not(.has-error):not(:has(.is-invalid)) {
    box-shadow: 0 0 0 3px var(--auth-orange-ring) !important;
}

.input-group-seamless:focus-within:not(.has-error):not(:has(.is-invalid)) .auth-input {
    background-color: #FFFFFF !important;
    border-color: var(--auth-orange-primary) !important;
    box-shadow: none !important;
}

.input-group-seamless:focus-within:not(.has-error):not(:has(.is-invalid)) .btn-toggle-eye {
    background-color: #FFFFFF !important;
    border-color: var(--auth-orange-primary) !important;
    color: var(--auth-orange-dark);
}

.input-group-seamless .btn-toggle-eye:hover {
    color: var(--auth-orange-dark);
}

/* Error / Invalid state for Password Input Group */
.input-group-seamless.has-error,
.input-group-seamless:has(.is-invalid) {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.input-group-seamless.has-error .auth-input,
.input-group-seamless:has(.is-invalid) .auth-input,
.input-group-seamless .auth-input.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    box-shadow: none !important;
}

.input-group-seamless.has-error .btn-toggle-eye,
.input-group-seamless:has(.is-invalid) .btn-toggle-eye,
.input-group-seamless .auth-input.is-invalid + .btn-toggle-eye {
    border-color: #EF4444 !important;
    color: #EF4444 !important;
    background-color: #FFFFFF !important;
    box-shadow: none !important;
}

.input-group-seamless.has-error .btn-toggle-eye i,
.input-group-seamless:has(.is-invalid) .btn-toggle-eye i,
.input-group-seamless .auth-input.is-invalid + .btn-toggle-eye i {
    color: #EF4444 !important;
}

.input-group-seamless.has-error .btn-toggle-eye:hover,
.input-group-seamless:has(.is-invalid) .btn-toggle-eye:hover,
.input-group-seamless .auth-input.is-invalid + .btn-toggle-eye:hover {
    color: #B91C1C !important;
}

.input-group-seamless.has-error .btn-toggle-eye:hover i,
.input-group-seamless:has(.is-invalid) .btn-toggle-eye:hover i,
.input-group-seamless .auth-input.is-invalid + .btn-toggle-eye:hover i {
    color: #B91C1C !important;
}

.input-group-seamless.has-error:focus-within,
.input-group-seamless:has(.is-invalid):focus-within {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28) !important;
}

.input-group-seamless.has-error ~ .invalid-feedback,
.input-group-seamless:has(.is-invalid) ~ .invalid-feedback {
    display: block !important;
}

/* 6. Math Captcha Security Box */
.auth-captcha-card {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-captcha-card:focus-within {
    border-color: #FED7AA;
    box-shadow: 0 4px 14px rgba(254, 119, 0, 0.08);
}

.auth-captcha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-captcha-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.auth-captcha-icon {
    color: #FE7700;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.auth-captcha-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    white-space: nowrap;
}

.auth-captcha-badge {
    display: inline-flex;
    align-items: center;
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FED7AA;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    line-height: 1.3;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.auth-captcha-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-captcha-challenge {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.auth-captcha-expression {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1.5px solid #FED7AA;
    border-radius: 10px;
    height: 46px;
    min-height: 46px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #C2410C;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    box-shadow: 0 1px 3px rgba(254, 119, 0, 0.06);
    user-select: none;
    padding: 0 12px;
}

.btn-reload-captcha {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    min-height: 46px;
    padding: 0 15px;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-reload-captcha i {
    font-size: 1.15rem;
    color: #64748B;
    transition: color 0.15s ease;
}

.btn-reload-captcha:hover {
    color: #FE7700;
    border-color: #FE7700;
    background: #FFF7ED;
    box-shadow: 0 3px 8px rgba(254, 119, 0, 0.14);
    transform: translateY(-1px);
}

.btn-reload-captcha:hover i {
    color: #FE7700;
}

.btn-reload-captcha:active {
    transform: translateY(0);
    background: #FFEDD5;
    border-color: #EA580C;
}

.btn-reload-captcha:focus-visible {
    outline: 2px solid #FE7700;
    outline-offset: 2px;
}

.btn-reload-captcha.spinning i {
    animation: auth-spin 0.6s linear infinite;
    display: inline-block;
    color: #FE7700;
}

@keyframes auth-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-captcha-input-wrap {
    width: 100%;
}

.auth-captcha-input-wrap .auth-input {
    width: 100% !important;
    height: 46px !important;
    background-color: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    border-radius: 10px !important;
    padding: 0 14px !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    color: #0F172A !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease !important;
}

.auth-captcha-input-wrap .auth-input:focus {
    border-color: #FE7700 !important;
    box-shadow: 0 0 0 3px rgba(254, 119, 0, 0.18) !important;
    outline: none !important;
}

.auth-captcha-input-wrap .auth-input::placeholder {
    color: #94A3B8;
    font-weight: 400;
}

/* Backward compatibility for auth-captcha-row if still referenced */
.auth-captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-captcha-row .auth-input {
    height: 46px !important;
    flex: 1 1 auto;
    background-color: #FFFFFF !important;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .auth-captcha-card {
        padding: 13px 14px;
        border-radius: 12px;
    }
    .auth-captcha-header {
        margin-bottom: 10px;
    }
    .auth-captcha-challenge {
        gap: 8px;
    }
    .auth-captcha-expression {
        height: 44px;
        min-height: 44px;
        font-size: 1.15rem;
        border-radius: 9px;
    }
    .btn-reload-captcha {
        height: 44px;
        min-height: 44px;
        padding: 0 12px;
        font-size: 0.8rem;
        border-radius: 9px;
        gap: 5px;
    }
    .btn-reload-captcha i {
        font-size: 1.05rem;
    }
    .auth-captcha-input-wrap .auth-input {
        height: 44px !important;
        border-radius: 9px !important;
        font-size: 0.9rem !important;
    }
}

@media (max-width: 360px) {
    .btn-reload-captcha {
        padding: 0 10px;
    }
    .btn-reload-text {
        font-size: 0.75rem;
    }
    .auth-captcha-tag {
        font-size: 0.7rem;
    }
}

/* 7. Action Button */
.btn-auth-submit {
    width: 100%;
    height: 46px;
    background: linear-gradient(180deg, #FE7700 0%, #E56A00 100%);
    border: 1px solid #CC5E00;
    border-radius: 8px;
    color: #FFFFFF !important;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.btn-auth-submit:hover:not(:disabled) {
    background: linear-gradient(180deg, #E56A00 0%, #C95400 100%);
    box-shadow: 0 4px 14px rgba(254, 119, 0, 0.35);
    transform: translateY(-1px);
}

.btn-auth-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 8. Links & Checkboxes */
.form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.15em;
    border: 1.5px solid #CBD5E1;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--auth-orange-dark) !important;
    border-color: var(--auth-orange-dark) !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--auth-orange-ring) !important;
    border-color: var(--auth-orange-primary) !important;
}

.auth-link-forgot {
    background: none;
    border: none;
    padding: 0;
    color: var(--auth-orange-dark);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link-forgot:hover {
    color: var(--auth-orange-deep);
    text-decoration: underline;
}

/* 9. Card Footer Note */
.auth-card-footer {
    border-top: 1px solid #F1F5F9;
    margin-top: 1.5rem;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 500;
}

/* 10. Top Generic Alert */
.auth-top-alert {
    background-color: #FEF2F2 !important;
    border: 1px solid #FECACA !important;
    color: #991B1B !important;
    border-radius: 8px !important;
    font-size: 0.84375rem !important;
}

.auth-top-alert i {
    color: #EF4444;
}

/* 11. Auth Modal System */
.auth-modal .modal-content {
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    background: #FFFFFF;
    overflow: hidden;
}

.auth-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #F1F5F9;
}

.auth-modal-header .auth-modal-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #FFF7ED;
    border: 1px solid #FFEDD5;
    color: var(--auth-orange-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.auth-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--auth-text-heading);
    margin: 0;
    line-height: 1.3;
}

.auth-modal-subtitle {
    font-size: 0.8125rem;
    color: var(--auth-text-muted);
    margin: 0.2rem 0 0 0;
}

.auth-modal-body {
    padding: 1.25rem 1.5rem;
}

.auth-modal-lead {
    font-size: 0.875rem;
    color: var(--auth-text-body);
    line-height: 1.55;
    margin-bottom: 1.15rem;
}

.auth-modal-steps {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.auth-modal-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-modal-step-item:hover {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.auth-modal-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: var(--auth-orange-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-modal-step-content {
    flex: 1 1 auto;
}

.auth-modal-step-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--auth-text-heading);
    margin-bottom: 2px;
}

.auth-modal-step-text {
    font-size: 0.8125rem;
    color: var(--auth-text-body);
    line-height: 1.45;
    margin: 0;
}

.auth-modal-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #FFF7ED;
    border: 1px solid #FFEDD5;
    border-radius: 8px;
    color: #9A3412;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.auth-modal-note i {
    font-size: 1.15rem;
    flex-shrink: 0;
    color: var(--auth-orange-dark);
}

.auth-modal-footer {
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
    border-top: none;
}
