:root {
    --rc-brand: #1b3c53;
    --rc-brand-2: #213c51;

    --rc-ink: #111827;
    --rc-muted: #6b7280;

    --rc-card: #ffffff;
    --rc-field: #f3f4f6;

    --rc-r12: 12px;
    --rc-r18: 18px;
    --rc-r28: 28px;
}

/* =========================================================
       AUTH PAGE WRAPPER (WAJIB dipakai pada wrapper terluar)
       ========================================================= */
.rc-auth-page {
    /* Full screen - no padding */
    min-height: 100vh;
    min-height: 100svh; /* mobile safe viewport */
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    /* background hanya untuk halaman auth, tidak ganggu global */
    background:
        radial-gradient(
            900px 420px at 18% 12%,
            rgba(238, 77, 45, 0.22),
            transparent 60%
        ),
        radial-gradient(
            900px 420px at 88% 88%,
            rgba(27, 60, 83, 0.22),
            transparent 60%
        ),
        linear-gradient(135deg, #0b1220, #111827);

    /* supaya shadow terlihat dan tidak clipping oleh parent */
    overflow: visible;
}

/* kalau theme kamu punya .main-wrapper.login-body yang kasih padding/height aneh,
       kita netralisir hanya pada halaman auth */
body.auth-page .main-wrapper.login-body {
    min-height: 100vh;
    min-height: 100svh;
    display: block;
    padding: 0;
    margin: 0;
}

/* =========================================================
       CONTAINER
       ========================================================= */
.rc-auth-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    width: 100vw;
    height: 100vh;
    min-height: 100vh;

    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    backdrop-filter: blur(10px) saturate(140%);
}

.rc-auth-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: var(--rc-card);
}
.rc-auth-container:not(.is-active)::after {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: none;
}
/* =========================================================
       FORM AREA (KIRI/KANAN)
       ========================================================= */
.rc-auth-form {
    position: absolute;
    right: 0;
    top: 0;
    /* transform: translateY(-50%); */
    width: 50%;
    height: 100%;
    /* max-height: 85%; */

    background: var(--rc-card);
    display: flex;
    align-items: center;

    padding: 40px;
    z-index: 1;

    transition:
        0.6s ease-in-out 1.1s,
        visibility 0s 1s;
    border-radius: 20px;
    /* overflow-y: auto; */
}
.rc-auth-forgot {
    width: 100%;
    text-align: right;
}
.rc-auth-forgot-password {
    padding-top: 20px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}
.rc-auth-forgot-password:hover {
    color: var(--rc-brand-2);
    text-decoration: none;
    border-radius: 4px;
    background: rgba(17, 24, 39, 0.06);
    padding: 2px 4px;
}

.rc-auth-container.is-active .rc-auth-form {
    right: 50%;
}

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

.rc-auth-form--register {
    visibility: hidden;
}

.rc-auth-container.is-active .rc-auth-form--register {
    visibility: visible;
}
.rc-auth-container.is-active .rc-auth-form--login {
    visibility: hidden;
    /* display: none !important; */
}
/* =========================================================
       TYPO + BACK
       ========================================================= */
.rc-auth-back {
    margin-bottom: 12px;
}

.rc-auth-back__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    text-decoration: none;
    color: #374151;

    font-weight: 800;
    font-size: 13px;

    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.05);
}

.rc-auth-back__btn:hover {
    background: rgba(17, 24, 39, 0.05);
    color: #111827;
}

.rc-auth-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--rc-ink);
    margin: 6px 0 6px;
    line-height: 1.05;
}

.rc-auth-subtitle {
    font-size: 13.5px;
    color: var(--rc-muted);
    margin: 0 0 18px;
}

/* =========================================================
       FIELDS
       ========================================================= */
.rc-auth-field {
    margin: 14px 0;
}

.rc-auth-label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #374151;
    margin-bottom: 7px;
}

.rc-auth-label span {
    color: var(--rc-brand);
}

.rc-auth-input {
    position: relative;
}

.rc-auth-input input {
    width: 100%;
    height: 46px;

    padding: 0 44px 0 14px;

    border-radius: var(--rc-r12);
    border: 1px solid rgba(17, 24, 39, 0.14);
    background: var(--rc-field);

    outline: none;
    font-weight: 650;
    color: #111827;

    transition:
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.rc-auth-input input::placeholder {
    color: rgba(17, 24, 39, 0.45);
    font-weight: 500;
}

.rc-auth-input input:focus {
    border-color: #1b3c53;
    box-shadow: 0 12px 28px rgba(27, 70, 88, 0.14);
    background: #fff;
}

/* Icons di field input - hanya direct child, bukan yang nested di dalam tombol */
.rc-auth-input > i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: rgba(17, 24, 39, 0.55);
    pointer-events: none;
}

/* password eye */
.rc-auth-input--password input {
    padding-right: 90px;
}

/* Tombol toggle password */
.rc-auth-input--password .toggle-password {
    position: absolute !important;
    right: 44px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;

    width: 34px;
    height: 34px;

    border-radius: 10px;
    border: none !important;
    background: transparent;

    color: rgba(17, 24, 39, 0.55);

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease;
    z-index: 10;
    padding: 0 !important;
    margin: 0 !important;

    /* Override global CSS */
    font-size: 0 !important;
}

.rc-auth-input--password .toggle-password:hover {
    background: rgba(17, 24, 39, 0.06) !important;
    color: rgba(17, 24, 39, 0.78) !important;
}

/* Icon styling - biarkan Font Awesome bekerja natural */
.rc-auth-input--password .toggle-password i {
    font-size: 18px !important;
    margin: 0 !important;
    position: static !important;
    transform: none !important;
    display: inline-block !important;
}

/* Disable tombol pseudo-elements untuk mencegah duplikasi */
.rc-auth-input--password .toggle-password::before,
.rc-auth-input--password .toggle-password::after {
    content: none !important;
    display: none !important;
}

/* PENTING: Jangan override icon pseudo-elements - biarkan Font Awesome bekerja */

/* phone prefix */
.rc-auth-input--phone {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rc-auth-prefix {
    height: 46px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;

    border-radius: var(--rc-r12);
    background: var(--rc-field);
    border: 1px solid rgba(17, 24, 39, 0.14);

    font-weight: 900;
    color: #111827;
    white-space: nowrap;
}

.rc-auth-input--phone input {
    padding-right: 44px;
}

.rc-auth-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

/* button */
.rc-auth-btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: var(--rc-r12);

    background: linear-gradient(135deg, var(--rc-brand), var(--rc-brand-2));
    color: #fff;

    font-weight: 900;
    letter-spacing: 0.2px;

    box-shadow: 0 12px 28px rgba(27, 70, 88, 0.14);
    transition:
        transform 0.18s ease,
        filter 0.18s ease;

    margin-top: 10px;
    cursor: pointer;
}

.rc-auth-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.rc-auth-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #6b7280;
}

.rc-auth-link {
    color: var(--rc-brand);
    font-weight: 900;
    text-decoration: none;
}

.rc-auth-link:hover {
    /* text-decoration: underline; */
    background: rgba(17, 24, 39, 0.06);
    color: rgba(17, 24, 39, 0.78);
    border-radius: 4px;
    padding: 2px 4px;
}

/* alerts */
.rc-auth-alert {
    border-radius: var(--rc-r12);
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 12px;
    flex-shrink: 0; /* Mencegah alert mengecil */
    width: 100%; /* Full width */
}

.rc-auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.rc-auth-alert--danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.26);
    color: #991b1b;
}

.rc-auth-alert--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.26);
    color: #166534;
}

.rc-auth-error {
    margin-top: 6px;
    font-size: 12px;
    color: #b91c1c;
    font-weight: 800;
}

/* =========================================================
       TOGGLE AREA
       ========================================================= */
.rc-auth-toggle {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none; /* panel button kita set pointer di tombol */
}

.rc-auth-toggle::before {
    content: "";
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;

    background: linear-gradient(135deg, var(--rc-brand));
    border-radius: 180px;

    transition: 1.8s ease-in-out;
}

.rc-auth-container.is-active .rc-auth-toggle::before {
    left: 50%;
}

.rc-auth-panel {
    position: absolute;
    width: 50%;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
    padding: 36px;

    color: #fff;
    transition: 0.6s ease-in-out;

    pointer-events: none;
}

.rc-auth-panel h2 {
    font-size: 30px;
    font-weight: 950;
    margin: 0 0 8px;
    line-height: 1.1;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.rc-auth-panel p {
    margin: 0 0 18px;
    opacity: 0.95;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.rc-auth-logo {
    width: 180px;
    height: auto;
    margin-bottom: 20px;
    object-fit: contain;
}

.rc-auth-panel--left {
    left: 0;
    transition-delay: 1.2s;
}

.rc-auth-container.is-active .rc-auth-panel--left {
    left: -50%;
    transition-delay: 0.6s;
}

.rc-auth-panel--right {
    right: -50%;
    transition-delay: 0.6s;
}

.rc-auth-container.is-active .rc-auth-panel--right {
    right: 0;
    transition-delay: 1.2s;
}

/* ghost button inside panel */
.rc-auth-btn--ghost {
    width: 170px;
    height: 44px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: none;
    pointer-events: auto; /* supaya bisa diklik walau parent pointer-events none */
}

.rc-auth-btn--ghost:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

/* =========================================================
       RESPONSIVE
       ========================================================= */

/* Tablet & below */
@media (max-width: 720px) {
    .rc-auth-page {
        padding: 16px 12px;
    }

    .rc-auth-container {
        /* jangan pakai calc(100vh - 40px) -> sering memotong di mobile browser */
        min-height: 640px;
        border-radius: 22px;
    }

    .rc-auth-form {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 70%;

        padding: 22px;
        align-items: flex-start; /* Diubah ke flex-start untuk natural flow */
    }

    .rc-auth-form--login {
        margin-top: 70%;
    }

    .rc-auth-form--register {
        margin-top: 15%;
    }

    .rc-auth-container.is-active .rc-auth-form {
        right: 0;
        bottom: 28%;
    }

    /* Alert styling untuk mobile */
    .rc-auth-alert {
        margin-bottom: 12px;
        flex-shrink: 0; /* Mencegah alert mengecil */
    }

    .rc-auth-toggle::before {
        left: 0;
        top: -270%;
        width: 100%;
        height: 300%;
        border-radius: 22vw;
    }

    .rc-auth-container.is-active .rc-auth-toggle::before {
        left: 0;
        top: 72%;
    }

    .rc-auth-panel {
        width: 100%;
        height: 28%;
        padding: 18px 18px;
    }

    .rc-auth-panel h2 {
        font-size: 24px;
    }

    .rc-auth-logo {
        width: 100px;
        margin-bottom: 12px;
    }

    .rc-auth-panel--left {
        top: 0;
        left: 0;
    }

    .rc-auth-panel--right {
        right: 0;
        bottom: -28%;
    }

    .rc-auth-container.is-active .rc-auth-panel--left {
        top: -28%;
        left: 0;
    }

    .rc-auth-container.is-active .rc-auth-panel--right {
        bottom: 0;
        right: 0;
    }
}

/* Small phones */
@media (max-width: 420px) {
    .rc-auth-title {
        font-size: 28px;
    }

    .rc-auth-form {
        padding: 18px;
    }

    .rc-auth-input input {
        height: 44px;
    }

    .rc-auth-prefix {
        height: 44px;
    }

    .rc-auth-btn {
        height: 44px;
    }

    .rc-auth-btn--ghost {
        width: 160px;
        height: 42px;
    }
}

/* =========================================================
       REGISTER MULTI-STEP ANIMATIONS
       ========================================================= */
#registerStep1,
#registerStep2 {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* =========================================================
   GOOGLE BUTTON (match style)
   ========================================================= */
.rc-auth-btn--google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background: #fff;
    color: #111827;

    border: 1px solid rgba(17, 24, 39, 0.14);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);

    margin-top: 12px;
    text-decoration: none;
}

.rc-auth-btn--google:hover {
    transform: translateY(-1px);
    filter: none;
    background: rgba(255, 255, 255, 0.96);
}

.rc-auth-google__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.04);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.rc-auth-google__text {
    font-weight: 900;
    letter-spacing: 0.2px;
    font-size: 13.5px;
}

/* Divider "atau" */
.rc-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0 6px;
    color: rgba(17, 24, 39, 0.55);
    font-weight: 800;
    font-size: 12px;
}

.rc-auth-divider::before,
.rc-auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(17, 24, 39, 0.12);
}

/* Mobile tweak */
@media (max-width: 420px) {
    .rc-auth-google__text {
        font-size: 13px;
    }
    .rc-auth-google__icon {
        width: 32px;
        height: 32px;
    }
}
