/*
 * auth.css
 * Gaya halaman autentikasi (Login, Register Mahasiswa, Register DPL, Ganti Password).
 * Konsep desain: dokumen akademik institusional Universitas Samudra.
 * Responsif: Desktop, Tablet (split layout seperti desktop), Mobile (single column rapi).
 */

:root {
    --auth-sidebar-w: 42%;
    --auth-rule-h: 4px;
}

body {
    font-family: var(--sikp-font-ui);
    color: var(--sikp-ink);
    background-color: var(--sikp-surface-muted);
    min-height: 100vh;
    margin: 0;
    padding-top: var(--auth-rule-h);
    overflow-x: hidden;
}

/* Garis merek institusi di tepi atas halaman */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--auth-rule-h);
    background: var(--sikp-brand);
    z-index: 2000;
}

/* ==========================================================================
   Tata Letak Belah (Split Layout) - Login, Register, Register DPL
   ========================================================================== */
.auth-wrapper {
    min-height: calc(100vh - var(--auth-rule-h));
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--sikp-surface);
}

/* Sidebar Institusi */
.auth-sidebar {
    display: none;
    background: var(--sikp-brand-deep);
    color: #d2dfdc;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-right: 1px solid var(--sikp-line);
}

.auth-sidebar-brand {
    font-family: var(--sikp-font-display);
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-sidebar-brand i {
    color: var(--sikp-brand-on-dark);
}

.auth-sidebar-content {
    margin: auto 0;
}

.auth-sidebar-text h1 {
    font-family: var(--sikp-font-display);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.auth-sidebar-text p {
    line-height: 1.6;
    color: #a3c1b7;
    margin: 0;
}

.auth-sidebar-footer {
    font-size: 0.8125rem;
    color: #a3c1b7;
}

/* Area Konten Utama Formulir */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sikp-surface);
}

.auth-form-card {
    width: 100%;
}

/* Mobile Brand Header (Hanya tampil pada layar < 768px) */
.auth-mobile-brand {
    display: block;
    margin-bottom: 1.75rem;
}

.auth-mobile-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--sikp-radius-surface);
    background: var(--sikp-brand-soft);
    color: var(--sikp-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--sikp-brand-line);
}

.auth-mobile-title {
    font-family: var(--sikp-font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--sikp-ink);
    margin: 0 0 0.25rem;
}

.auth-mobile-subtitle {
    font-size: 0.84375rem;
    color: var(--sikp-muted);
    margin: 0;
}

.auth-header {
    margin-bottom: 1.75rem;
}

.auth-header h3 {
    font-family: var(--sikp-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sikp-ink);
    margin: 0 0 0.375rem;
}

.auth-header p {
    color: var(--sikp-muted);
    font-size: 0.9375rem;
    margin: 0;
}

/* ==========================================================================
   Form Controls, Inputs, and Floating Labels
   ========================================================================== */
.form-floating > .form-control,
.form-floating > .form-select {
    border-color: var(--sikp-control-line);
    border-radius: var(--sikp-radius-control);
    color: var(--sikp-ink);
    font-size: 0.9375rem;
    height: 3.5rem;
    padding-left: 0.875rem;
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--sikp-brand);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.25);
}

.form-floating > label {
    color: var(--sikp-muted);
    font-size: 0.875rem;
    padding-left: 0.875rem;
}

.password-toggle-absolute {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--sikp-muted);
    cursor: pointer;
    z-index: 5;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--sikp-radius-control);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.password-toggle-absolute:hover,
.password-toggle-absolute:focus-visible {
    color: var(--sikp-ink);
    background-color: var(--sikp-surface-muted);
    outline: none;
}

.invalid-feedback {
    font-size: 0.8125rem;
    color: var(--sikp-danger);
    font-weight: 500;
}

/* ==========================================================================
   Tombol Aksi (Buttons)
   ========================================================================== */
.btn-primary-premium,
.btn-success-premium {
    background-color: var(--sikp-brand);
    border-color: var(--sikp-brand);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.96875rem;
    min-height: 46px;
    padding: 0.65rem 1.25rem;
    border-radius: var(--sikp-radius-control);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary-premium:hover,
.btn-primary-premium:focus-visible,
.btn-success-premium:hover,
.btn-success-premium:focus-visible {
    background-color: var(--sikp-brand-hover);
    border-color: var(--sikp-brand-hover);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(4, 120, 87, 0.28);
}

.btn-primary-premium:active,
.btn-success-premium:active {
    background-color: var(--sikp-brand-deep);
    border-color: var(--sikp-brand-deep);
    color: #ffffff;
}

.auth-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--sikp-muted);
    font-size: 0.8125rem;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--sikp-line);
}

.auth-separator span {
    padding: 0 0.75rem;
}

/* ==========================================================================
   Tata Letak Terpusat (Ganti Password)
   ========================================================================== */
.auth-centered-layout {
    min-height: calc(100vh - var(--auth-rule-h));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem 1.25rem;
    background-color: var(--sikp-surface-muted);
}

.ganti-pass-card {
    width: 100%;
    max-width: 460px;
    background: var(--sikp-surface);
    border: 1px solid var(--sikp-line);
    border-radius: var(--sikp-radius-surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    padding: 2.25rem 2rem;
}

.icon-header {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sikp-brand-soft);
    color: var(--sikp-brand);
    border: 1px solid var(--sikp-brand-line);
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    font-size: 1.4rem;
}

/* ==========================================================================
   Media Queries: Mobile, Tablet (seperti Desktop), dan Desktop
   ========================================================================== */

/* Mobile (< 768px) */
@media (max-width: 767.98px) {
    .auth-sidebar {
        display: none !important;
    }

    .auth-mobile-brand {
        display: block;
    }

    .auth-main {
        padding: 2rem 1.25rem;
        align-items: flex-start;
    }

    .auth-form-card {
        max-width: 100%;
    }

    .ganti-pass-card {
        padding: 1.75rem 1.25rem;
    }
}

/* Tablet (768px - 991.98px) -> Dibuat split-screen seperti desktop web */
@media (min-width: 768px) and (max-width: 991.98px) {
    .auth-wrapper {
        flex-direction: row;
    }

    .auth-sidebar {
        display: flex;
        width: 38%;
        min-width: 280px;
        padding: 2.25rem 1.5rem;
    }

    .auth-mobile-brand {
        display: none !important;
    }

    .auth-sidebar-brand {
        font-size: 1.25rem;
    }

    .auth-sidebar-text h1 {
        font-size: 1.625rem;
        margin-bottom: 0.75rem;
    }

    .auth-sidebar-text p {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .auth-main {
        flex: 1;
        padding: 2rem 1.75rem;
        overflow-y: auto;
        max-height: calc(100vh - var(--auth-rule-h));
    }

    .auth-form-card {
        max-width: 24rem;
    }

    .auth-main.wide-form .auth-form-card {
        max-width: 32rem;
    }
}

/* Desktop Web (>= 992px) */
@media (min-width: 992px) {
    .auth-wrapper {
        flex-direction: row;
    }

    .auth-sidebar {
        display: flex;
        width: 40%;
        padding: 3.5rem 3rem;
    }

    .auth-mobile-brand {
        display: none !important;
    }

    .auth-sidebar-brand {
        font-size: 1.5rem;
    }

    .auth-sidebar-text h1 {
        font-size: 2.25rem;
    }

    .auth-sidebar-text p {
        font-size: 1rem;
    }

    .auth-main {
        flex: 1;
        padding: 3rem 2.5rem;
        overflow-y: auto;
        max-height: calc(100vh - var(--auth-rule-h));
    }

    .auth-form-card {
        max-width: 26rem;
    }

    .auth-main.wide-form .auth-form-card {
        max-width: 38rem;
    }
}

/* Desktop Lebar (>= 1200px) */
@media (min-width: 1200px) {
    .auth-sidebar {
        width: 42%;
        padding: 4rem 3.5rem;
    }

    .auth-main {
        padding: 3.5rem 4rem;
    }

    .auth-form-card {
        max-width: 27rem;
    }

    .auth-main.wide-form .auth-form-card {
        max-width: 40rem;
    }
}
