/* ===== RESET & VARIABLES ===== */
:root {
    --primary: #5d87ff;
    --primary-dark: #4b6ed7;
    --secondary: #49beff;
    --success: #13deb9;
    --danger: #fa896b;
    --warning: #ffae1f;
    --dark: #2a3547;
    --light: #f6f9fc;
    --muted: #5a6a85;
    --white: #ffffff;
    --border: #ebf1f6;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius: 20px;
    --radius-sm: 10px;
    --font-family:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(145deg, #f0f4f8 0%, #e6ecf4 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* ===== PAGE WRAPPER - FIXED CENTERING ===== */
.page-wrapper {
    position: relative;
    width: 100%;
}

.text-bg-light {
    background: linear-gradient(145deg, #f5f9ff 0%, #eef2f9 100%);
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Perbaikan centering container */
.d-flex.align-items-center.justify-content-center.w-100 {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== CARD STYLES - PROPORTIONAL ===== */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 450px; /* Batasi lebar maksimum card */
    margin: 0 auto; /* Center card */
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(93, 135, 255, 0.12);
}

.card-body {
    padding: 3rem 2.8rem;
}

/* Responsive padding untuk card */
@media (max-width: 576px) {
    .card-body {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 1200px) {
    .card-body {
        padding: 3.5rem 3.2rem;
    }
}

/* ===== ROW SYSTEM IMPROVEMENT ===== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    width: 100%;
}

.row.justify-content-center {
    justify-content: center;
}

.row > * {
    padding: 0;
}

/* ===== COLUMN SYSTEM - BETTER SPACING ===== */
.col-md-8,
.col-lg-6,
.col-xxl-3 {
    position: relative;
    width: 100%;
    padding: 0 1rem; /* Add horizontal padding */
}

/* Desktop Large (1200px ke atas) */
@media (min-width: 1400px) {
    .col-xxl-3 {
        flex: 0 0 auto;
        width: 33.333%;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .col-lg-6 {
        flex: 0 0 auto;
        width: 50%;
        max-width: 550px;
        margin: 0 auto;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .col-md-8 {
        flex: 0 0 auto;
        width: 66.666%;
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .col-md-8 {
        width: 100%;
        padding: 0 1.5rem;
    }

    .text-bg-light {
        padding: 1rem;
    }

    .d-flex.align-items-center.justify-content-center.w-100 {
        padding: 1rem;
    }
}

/* ===== LOGO STYLES ===== */
.logo-img {
    margin-bottom: 1rem;
    display: block;
}

.logo-img img {
    max-width: 200px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover img {
    transform: scale(1.02);
}

.text-center p {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.text-center p::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

/* ===== FORM STYLES ===== */
.form-label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 0.6rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    background: #fafcff;
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(93, 135, 255, 0.12);
    background: var(--white);
}

.form-control::placeholder {
    color: #b8c2d2;
    font-weight: 400;
}

/* ===== CHECKBOX STYLES ===== */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #d0d9e8;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input.primary:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-check-label {
    font-size: 0.95rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

/* ===== BUTTON STYLES ===== */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6d9aff 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 16px rgba(93, 135, 255, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(
        135deg,
        var(--primary-dark) 0%,
        var(--primary) 100%
    );
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(93, 135, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.py-8 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.fs-4 {
    font-size: 1.05rem;
}

.rounded-2 {
    border-radius: var(--radius-sm);
}

.w-100 {
    width: 100%;
}

/* ===== LINK STYLES ===== */
a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--primary-dark);
}

.text-primary {
    color: var(--primary) !important;
}

.text-primary:hover {
    color: var(--primary-dark) !important;
}

.fw-bold {
    font-weight: 600;
}

/* ===== FORGOT PASSWORD LINK ===== */
.mb-4 a {
    font-size: 0.95rem;
    position: relative;
    display: inline-block;
}

.mb-4 a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.mb-4 a:hover::after {
    width: 100%;
}

/* ===== CREATE ACCOUNT LINK ===== */
.d-flex.align-items-center.justify-content-center {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f4fa;
}

.fs-4.mb-0 {
    color: var(--muted);
    font-size: 1rem !important;
}

.ms-2 {
    margin-left: 0.8rem;
    font-weight: 600;
}

/* ===== UTILITY CLASSES ===== */
.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.text-center {
    text-align: center;
}

.d-block {
    display: block;
}

.position-relative {
    position: relative;
}

.overflow-hidden {
    overflow: hidden;
}

.min-vh-100 {
    min-height: 100vh;
}

.w-100 {
    width: 100%;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 1.3rem;
}

.mb-4 {
    margin-bottom: 1.8rem;
}

.py-3 {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
}

/* ===== SPACING FIXES ===== */
.mb-4:last-of-type {
    margin-bottom: 2rem;
}

/* ===== CARD DECORATION ===== */
.card {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--secondary),
        var(--primary)
    );
    border-radius: var(--radius) var(--radius) 0 0;
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

/* ===== BACKGROUND DECORATION ===== */
.text-bg-light {
    position: relative;
    overflow: hidden;
}

.text-bg-light::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -10%;
    width: 70%;
    height: 70%;
    background: radial-gradient(
        circle,
        rgba(93, 135, 255, 0.05) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

.text-bg-light::after {
    content: "";
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(
        circle,
        rgba(73, 190, 255, 0.05) 0%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.7s ease-out;
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

/* ===== ALERT STYLES ===== */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 10px;
    position: relative;
    font-size: 0.95rem;
}

.alert-danger {
    background: linear-gradient(135deg, #fee9e7 0%, #fed7d3 100%);
    color: #fa896b;
    border-left: 4px solid #fa896b;
}

.alert-dismissible {
    padding-right: 3rem;
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1.2rem 1rem;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 1rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Animasi alert */
.alert {
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Icon dalam alert */
.alert .d-flex {
    gap: 0.5rem;
    align-items: center;
}

.alert i,
.alert iconify-icon {
    font-size: 1.2rem;
}

.alert ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.alert ul li {
    margin-bottom: 0.2rem;
}
