/* ============================================================
   auth.css  —  Styles Login & Register (semua dalam 1 file)
   Lokasi : public/assets/css/layout/auth.css
   ============================================================ */

:root {
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-primary-light: #eaf1ff;
    --auth-text-dark: #0f172a;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-danger: #ef4444;
    --auth-success: #22c55e;
    --auth-warning: #f59e0b;
    --auth-radius: 12px;
}

/* ===================  LAYOUT  =================== */

.page {
    min-height: 100vh;
    display: flex;
}

/* ===================  BRAND PANEL (KIRI)  =================== */

.brand-panel {
    flex: 0 0 30%;
    max-width: 30%;
    position: sticky;
    top: 0;
    height: 100vh;
    background:
        linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px) 0 0 / 32px
            32px,
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px) 0
            0 / 32px 32px,
        #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 48px;
}

.brand-blob {
    position: absolute;
    border-radius: 50%;
    background: var(--auth-primary-light);
    z-index: 0;
    pointer-events: none;
}
.brand-blob-1 {
    width: 340px;
    height: 340px;
    top: -160px;
    left: -160px;
    opacity: 0.9;
}
.brand-blob-2 {
    width: 300px;
    height: 300px;
    top: 420px;
    left: 140px;
    opacity: 0.7;
}
.brand-blob-3 {
    width: 420px;
    height: 420px;
    bottom: -220px;
    left: -60px;
    opacity: 0.6;
}

.brand-logo-wrap {
    position: relative;
    z-index: 1;
    margin-bottom: 24px;
    opacity: 0;
    animation: authFadeUp 0.6s ease forwards;
    text-align: center;
}

.brand-logo-wrap img {
    margin-left: 40px;
    width: 230px;
    animation: authFloat 5s ease-in-out infinite;
}

.brand-title {
    position: relative;
    z-index: 1;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0;
    opacity: 0;
    animation: authFadeUp 0.6s ease 0.1s forwards;
    text-align: center;
}

.brand-sub {
    position: relative;
    z-index: 1;
    font-size: 0.88rem;
    color: var(--auth-text-muted);
    margin: 10px auto 0;
    max-width: 320px;
    line-height: 1.6;
    opacity: 0;
    animation: authFadeUp 0.6s ease 0.15s forwards;
    text-align: center;
}

.brand-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    font-size: 0.82rem;
    color: var(--auth-text-muted);
    opacity: 0;
    animation: authFadeUp 0.6s ease 0.2s forwards;
}

/* ===================  FORM PANEL (KANAN)  =================== */

.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 48px;
}

.form-wrap {
    width: 100%;
    max-width: 560px;
    opacity: 0;
    transform: translateY(20px);
    animation: authFormIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

/* Register butuh sedikit lebih lebar */
#registerForm ~ * .form-wrap,
.register-wrap {
    max-width: 600px;
}

/* ===================  TYPOGRAPHY  =================== */

.form-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-sub {
    color: var(--auth-text-muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}
.form-label {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 8px;
    color: var(--auth-text-dark);
    display: block;
}
.form-label .req {
    color: var(--auth-danger);
    margin-left: 2px;
}

/* ===================  INPUT  =================== */

.mb-field {
    margin-bottom: 22px;
}

.input-group-custom {
    position: relative;
    margin-bottom: 6px;
}
.input-group-custom .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    transition: color 0.2s ease;
    z-index: 3;
    pointer-events: none;
}
.input-group-custom.focused .icon {
    color: var(--auth-primary);
}

.form-control-custom,
.form-select-custom {
    width: 100%;
    padding: 13px 16px 13px 46px;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius);
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.25s ease;
    outline: none;
    appearance: none;
    color: var(--auth-text-dark);
    font-family: inherit;
}
.form-control-custom::placeholder {
    color: #94a3b8;
}
.form-control-custom:focus,
.form-select-custom:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.form-control-custom.is-invalid,
.form-select-custom.is-invalid {
    border-color: var(--auth-danger);
}
.form-control-custom.is-valid,
.form-select-custom.is-valid {
    border-color: var(--auth-success);
}

.form-select-custom {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ===================  TOGGLE PASSWORD  =================== */

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    font-size: 1rem;
    cursor: pointer;
    z-index: 3;
    padding: 4px;
    transition: color 0.2s ease;
}
.toggle-password:hover {
    color: var(--auth-primary);
}

/* ===================  FIELD MESSAGES  =================== */

.field-hint {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin-top: 6px;
}
.field-error {
    font-size: 0.78rem;
    color: var(--auth-danger);
    margin-top: 6px;
    min-height: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}
.field-error.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===================  BUTTONS  =================== */

.btn-auth {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--auth-radius);
    background: linear-gradient(
        135deg,
        var(--auth-primary),
        var(--auth-primary-dark)
    );
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.25s ease;
    box-shadow: 0 10px 25px -8px rgba(37, 99, 235, 0.55);
    margin-top: 8px;
}
.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(37, 99, 235, 0.65);
}
.btn-auth:active {
    transform: translateY(0);
}
.btn-auth i.fa-arrow-right {
    transition: transform 0.25s ease;
}
.btn-auth:hover i.fa-arrow-right {
    transform: translateX(4px);
}
.btn-auth.loading {
    pointer-events: none;
    color: transparent;
}
.btn-auth .spinner-border {
    position: absolute;
    width: 1.2rem;
    height: 1.2rem;
    display: none;
}
.btn-auth.loading .spinner-border {
    display: inline-block;
}

.btn-secondary-auth {
    width: 100%;
    padding: 13px;
    border-radius: var(--auth-radius);
    border: 1.5px solid var(--auth-border);
    background: #fff;
    color: var(--auth-text-dark);
    font-weight: 600;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}
.btn-secondary-auth:hover {
    border-color: var(--auth-primary);
    background: var(--auth-primary-light);
    color: var(--auth-primary-dark);
}

/* ===================  RIPPLE  =================== */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: authRipple 0.6s linear;
    pointer-events: none;
}

/* ===================  ALERT  =================== */

.alert-custom {
    border-radius: 10px;
    font-size: 0.85rem;
    padding: 11px 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

/* ===================  LOGIN – SPESIFIK  =================== */

.wave-emoji {
    display: inline-block;
    animation: loginWave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

.row-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 26px;
    font-size: 0.875rem;
}
.custom-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--auth-text-muted);
    user-select: none;
}
.custom-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}
.link-forgot {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}
.link-forgot:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--auth-text-muted);
    font-size: 0.82rem;
    margin: 26px 0 18px;
}
.divider-text::before,
.divider-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* ===================  REGISTER – SPESIFIK  =================== */

.strength-meter {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}
.strength-meter span {
    height: 4px;
    flex: 1;
    border-radius: 4px;
    background: var(--auth-border);
    transition: background 0.25s ease;
}
.strength-label {
    font-size: 0.78rem;
    margin-top: 6px;
    font-weight: 600;
    color: var(--auth-text-muted);
    min-height: 18px;
}

.login-link {
    text-align: center;
    margin-top: 22px;
    font-size: 0.92rem;
    color: var(--auth-text-muted);
}
.login-link a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}
.login-link a:hover {
    text-decoration: underline;
    color: var(--auth-primary-dark);
}

/* ===================  ANIMASI  =================== */

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes authFormIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes authFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}
@keyframes authRipple {
    to {
        transform: scale(3);
        opacity: 0;
    }
}
@keyframes authShake {
    10%,
    90% {
        transform: translateX(-1px);
    }
    20%,
    80% {
        transform: translateX(2px);
    }
    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }
    40%,
    60% {
        transform: translateX(4px);
    }
}
@keyframes loginWave {
    0%,
    60%,
    100% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(14deg);
    }
    20% {
        transform: rotate(-8deg);
    }
    30% {
        transform: rotate(14deg);
    }
    40% {
        transform: rotate(-4deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

.shake {
    animation: authShake 0.4s ease;
}

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

@media (max-width: 991.98px) {
    .page {
        flex-direction: column;
    }
    .brand-panel {
        position: relative;
        height: auto;
        flex: none;
        max-width: 100%;
        padding: 28px 32px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 18px;
    }
    .brand-logo-wrap {
        margin-bottom: 0;
    }
    .brand-logo-wrap img {
        width: 56px;
    }
    .brand-title {
        font-size: 1.3rem;
    }
    .brand-sub,
    .brand-footer {
        display: none;
    }
    .form-panel {
        padding: 40px 28px 56px;
    }
}

@media (max-width: 575.98px) {
    .brand-panel {
        padding: 24px 20px;
    }
    .form-panel {
        padding: 32px 18px 48px;
    }
    .form-title {
        font-size: 1.6rem;
    }
    .row-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
