/* =============================================
   auth.css — SMA Negeri 10 Pontianak
   ============================================= */

/* ── GLOBAL RESET ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

:root {
    --green-dark: #1a5c2a;
    --green-main: #2a7a3b;
    --green-light: #3a9b50;
    --white: #ffffff;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    height: 100vh;
    overflow: hidden;
    background-color: #f8faf9;
}

/* MATIKAN SEMUA ANIMASI SAAT ERROR */
.no-anim * {
    animation: none !important;
    transition: none !important;
}

/* ── CONTAINER ── */
.login-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ══════════════════════════════════════════
   LEFT SIDE — Brand + Image Slider
   ══════════════════════════════════════════ */
.login-left {
    flex: 1.2;
    background: linear-gradient(155deg, var(--green-dark) 0%, var(--green-main) 60%, var(--green-light) 100%);
    padding: 44px 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Dekorasi lingkaran di background */
.login-left::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    top: -80px;
    right: -80px;
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    bottom: -120px;
    left: -120px;
    pointer-events: none;
}

/* ── LOGO ── */
.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 3;
    position: relative;
    animation: fadeDown 0.6s ease both;
}

.logo img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.25));
}

.logo span {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── IMAGE SLIDER ── */
.slider-wrapper {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
    height: 380px;
    animation: fadeUp 1s ease 0.2s both;
    overflow: hidden;
    /* Keluar dari padding parent kiri-kanan */
    margin-left: -52px;
    margin-right: -52px;
    /* Fade hanya atas dan bawah */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}

.slider-track {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    transition: none;
}

.slide {
    min-width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    border-radius: 0;
    box-shadow: none;
    filter: none;
}

/* Caption teks di dalam slide */
.slide-caption {
    position: absolute;
    bottom: 14px;
    left: 18px;
    right: 18px;
    z-index: 2;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.05em;
}

/* Dot navigator */
.slider-dots {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.slider-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.slider-dot.active {
    background: var(--white);
    width: 20px;
    border-radius: 3px;
}

/* Arrow buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
    line-height: 1;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

/* ── WELCOME TEXT ── */
.welcome-text {
    z-index: 3;
    position: relative;
    animation: fadeUp 0.7s ease 0.35s both;
}

.welcome-text .hero-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.welcome-text .hero-title {
    font-size: clamp(20px, 2.2vw, 30px);
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.welcome-text .hero-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    max-width: 500px;
    margin-top: 8px;
}

/* ══════════════════════════════════════════
   RIGHT SIDE — Form
   ══════════════════════════════════════════ */
.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: #f8faf9;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background: white;
    padding: 44px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.07);
    animation: fadeUp 0.6s ease 0.1s both;
}

.login-card h2 {
    text-align: center;
    color: var(--green-dark);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 28px;
    letter-spacing: 0.05em;
}

/* ── FORM ELEMENTS ── */
form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 7px;
    margin-top: 18px;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form input[type="tel"] {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #ececec;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fdfdfd;
    margin-bottom: 14px;
}

form input:focus,
form select:focus {
    outline: none;
    border-color: var(--green-main);
    background: white;
    box-shadow: 0 0 0 4px rgba(42, 122, 59, 0.1);
}

/* ── PASSWORD TOGGLE ── */
.pwd-input-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 14px;
}

.pwd-input-wrap input {
    margin-bottom: 0 !important;
    padding-right: 46px !important;
}

.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
}

.pwd-input-wrap:focus-within .eye-btn {
    opacity: 1;
    pointer-events: all;
}

.eye-btn:hover {
    color: var(--green-main);
}

.eye-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

form select {
    width: 100%;
    padding: 13px 16px;
    padding-right: 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #ffffff;
    margin-bottom: 14px;
    cursor: pointer;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232a7a3b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

form select:hover {
    border-color: var(--green-main);
    background-color: #fcfdfc;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-top: 10px;
}

.remember {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    cursor: pointer;
    color: #666;
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
}

.remember input {
    margin: 0 !important;
    width: 15px !important;
    height: 15px !important;
    cursor: pointer;
    accent-color: var(--green-main);
    flex-shrink: 0;
}

.login-options a {
    color: var(--green-main);
    text-decoration: none;
    font-weight: 600;
    line-height: normal !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
}

.login-options a:hover {
    text-decoration: underline;
}

/* ── BUTTON ── */
.btn-login {
    width: 100%;
    background: var(--green-dark);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.btn-login:hover {
    background: #144520;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 92, 42, 0.25);
}

/* ── REGISTER TEXT ── */
.register-text {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: #777;
}

.register-text a {
    color: var(--green-dark);
    text-decoration: none;
    font-weight: 700;
}

.register-text a:hover {
    text-decoration: underline;
}

/* TOAST ERROR*/
.toast-error {
    position: fixed;
    top: 20px;
    right: 20px;

    background: #ff4d4f;
    color: white;
    padding: 14px 18px;
    border-radius: 12px;

    font-size: 14px;
    font-weight: 500;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    will-change: transform, opacity;

    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

/* MUNCUL (POP EFFECT) */
.toast-error.show {
    opacity: 1;
    transform: scale(1);
}

/* TOAST SUCCESS */
.toast-success {
    position: fixed;
    top: 20px;
    right: 20px;

    background: #52c41a;
    color: white;
    padding: 14px 18px;
    border-radius: 12px;

    font-size: 14px;
    font-weight: 500;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    will-change: transform, opacity;

    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.toast-success.show {
    opacity: 1;
    transform: scale(1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── ANIMATIONS ── */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 900px)
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
    html, body {
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .login-container {
        flex-direction: column;
        display: block; /* Biar mengalir secara vertikal */
        height: auto;
        min-height: 100dvh;
    }

    .login-left {
        flex: none;
        padding: 28px 24px 36px;
        gap: 20px;
    }

    .slider-wrapper {
        height: 180px;
        margin-left: -24px;
        margin-right: -24px;
    }

    .welcome-text .hero-eyebrow {
        font-size: 10px;
    }
    
    .welcome-text .hero-title {
        font-size: clamp(16px, 3.5vw, 20px);
    }
    
    .welcome-text .hero-sub {
        font-size: 12px;
    }

    .login-right {
        flex: none;
        padding: 10px 20px 180px; /* Ditambah padding bawah lebih besar agar bisa di-scroll saat keyboard muncul */
        background-color: #f8faf9;
        display: flex;
        justify-content: center;
    }

    .login-card {
        max-width: 100%;
        width: 100%;
        padding: 32px 24px;
        margin-top: -10px; /* Tarik sedikit ke atas agar lebih pas */
    }

    /* KECILKAN FONT INPUT & PLACEHOLDER UNTUK SEMUA MOBILE/TABLET */
    .login-card form input[type="text"],
    .login-card form input[type="password"],
    .login-card form input[type="email"],
    .login-card form input[type="tel"],
    .login-card form select {
        font-size: 12.5px !important;
        padding: 11px 15px !important;
    }
    .login-card form input::placeholder {
        font-size: 12.5px !important;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 480px)
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
    .login-left {
        padding: 24px 18px 28px;
    }

    .slider-wrapper {
        height: 160px;
        margin-left: -18px;
        margin-right: -18px;
    }

    .logo img {
        width: 36px;
        height: 36px;
    }

    .logo span {
        font-size: 9.5px;
    }

    .welcome-text .hero-eyebrow {
        font-size: 9px;
    }

    .welcome-text .hero-title {
        font-size: 16px !important;
        margin-bottom: 2px;
    }

    .welcome-text .hero-sub {
        font-size: 11px !important;
        line-height: 1.4;
    }

    .login-card {
        padding: 28px 18px;
    }

    .login-card h2 {
        font-size: 22px;
    }

    .btn-login {
        font-size: 14px;
    }

    /* Font size input sudah diatur di breakpoint 900px */
    .login-options, 
    .register-text {
        font-size: 11.5px !important;
    }

    /* SEMBUNYIKAN PANAH SLIDER DI HP AGAR TIDAK SEMAK */
    .slider-btn {
        display: none !important;
    }

    /* KECILKAN DOTS SLIDER DI MOBILE */
    .slider-dots {
        bottom: 8px !important;
        right: 12px !important;
        gap: 5px !important;
    }
    .slider-dot {
        width: 5px !important;
        height: 5px !important;
        padding: 0 !important;
        border: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        background: rgba(255, 255, 255, 0.3) !important;
    }
    .slider-dot.active {
        width: 14px !important;
        height: 5px !important;
        border-radius: 3px !important;
        background: #fff !important;
    }
}