:root {
    --primary: #5b21b6;
    --primary-light: #d6d7fe;
    --primary-dark: #5b21b6;
    --secondary: #10b981;
    --tertiary: #f59e0b;
    --danger: #ef4444;
    --dark: #18181b;
    --text: #4b5563;
    --gray: #9ca3af;
    --light-gray: #e5e7eb;
    --lighter-gray: #f9fafb;
    --white: #ffffff;
    --card-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    /* font-weight: bold; */
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

body {
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 20px;
}

/* Background untuk desktop */
@media (min-width: 769px) {
    body {
        background: linear-gradient(
                rgba(255, 255, 255, 0.6),
                rgba(255, 255, 255, 0.6)
            ),
            url("../images/bambu_runcing_v2.jpg") top center / cover no-repeat fixed;
    }
}

/* Background untuk mobile */
@media (max-width: 768px) {
    body {
        background: var(--text); /* Warna background fallback */
    }
    
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background: linear-gradient(
                rgba(255, 255, 255, 0.6),
                rgba(255, 255, 255, 0.6)
            ),
            url("../images/bambu_runcing_v2.jpg") center center / cover no-repeat;
        z-index: -1;
        transform: translateZ(0); /* Membantu mencegah perubahan scale saat scroll */
        -webkit-backface-visibility: hidden; /* Membantu mencegah flicker */
        will-change: transform; /* Optimasi performa */
    }
}


/* Header */
.header {
    margin-top: 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--primary);
    width: 160px;
    height: 160px;
    border-radius: 40px;
    font-size: 32px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.app-logo::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border: 2px dashed var(--primary-light);
    border-radius: 50px;
    z-index: -1;
}

.app-logo img {
    height: 80%;
    width: auto;
}

.header h1 {
    color: var(--dark);
    font-size: 28px;
    font-weight: 800;
    /* margin-bottom: 15px; */
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--dark);
    font-weight: bold;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Container */
.container {
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* Card */
.card {
    background: none;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    /* box-shadow: var(--card-shadow); */
    padding: 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: visible;
}

/* .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        to right,
        var(--primary),
        var(--secondary),
        var(--tertiary)
    );
} */

.card-header {
    display: flex;
    align-items: center;
    /* justify-content: center; */
    /* margin-bottom: 30px; */
    /* padding-bottom: 20px; */
    /* border-bottom: 1px solid var(--light-gray); */
}

.card-icon {
    background-color: var(--primary-light);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-right: 16px;
    color: var(--primary);
    font-size: 20px;
}

.card-title {
    color: var(--dark);
    font-size: 22px;
    font-weight: 700;
}

/* Form elements */
.form-section {
    /* margin-bottom: 30px; */
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: "";
    height: 1px;
    background-color: var(--dark);
    flex: 1;
    margin-left: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    /* margin-bottom: 20px; */
}

.form-group {
    flex: 1;
    margin-bottom: 20px;
    position: relative;
    overflow: visible;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-label small {
    color: var(--black);
    font-weight: normal;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.25s ease;
    color: var(--text);
    background-color: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-control::placeholder {
    color: var(--gray);
}

/* Standardize height for form controls and select triggers */
.form-control,
.select-trigger {
    padding: 12px 16px;
    line-height: 1.5;
    height: 48px;
    /* Set a fixed height */
    box-sizing: border-box;
}

/* Ensure the select trigger text is vertically centered */
.select-trigger span {
    line-height: 24px;
    display: inline-block;
    vertical-align: middle;
}

/* Make sure the tahun_kelulusan input has the same height */
#tahun_kelulusan {
    height: 48px;
}

/* Phone input with prefix */
.phone-input {
    display: flex;
    border-radius: 10px;
    border: 1px solid var(--light-gray);
    overflow: hidden;
    transition: all 0.25s ease;
}

.phone-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.phone-prefix {
    background-color: var(--lighter-gray);
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    border-right: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.phone-input input {
    flex: 1;
    border: none;
    border-radius: 0;
    padding: 12px 16px;
    font-size: 15px;
}

.phone-input input:focus {
    outline: none;
}

/* Custom select dropdown - completely redesigned */
.custom-select {
    position: relative;
}

.select-trigger {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
    font-size: 15px;
    color: var(--text);
}

.select-trigger.placeholder {
    color: var(--gray);
}

.select-trigger:hover {
    border-color: var(--primary-light);
}

.select-trigger:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.select-arrow {
    margin-left: 10px;
    transition: transform 0.25s ease;
    color: var(--primary);
}

.select-trigger[aria-expanded="true"] .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    z-index: 999;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--light-gray);
}

.select-dropdown.active {
    max-height: 250px;
    opacity: 1;
    transform: translateY(0);
}

.select-search {
    padding: 12px;
    border-bottom: 1px solid var(--light-gray);
}

.select-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-size: 14px;
}

.select-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.select-options {
    max-height: 180px;
    overflow-y: auto;
    padding: 8px 0;
    /* Fix for mobile scrolling issue */
    -webkit-overflow-scrolling: touch;
}

/* Fixed scroll issue - lock body scroll when dropdown is active */
body.dropdown-active {
    overflow: hidden;
}

.select-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.select-option:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.select-option.selected {
    background-color: var(--primary);
    color: var(--white);
    font-weight: 500;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -3px rgba(124, 58, 237, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

/* Alert messages */
.alert {
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--secondary);
    color: #065f46;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: #b91c1c;
}

.alert ul {
    margin-left: 20px;
    margin-top: 8px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: var(--white);
    font-size: 14px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Form Progress */
.form-progress {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .card {
        padding: 30px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 15px;
    }

    .form-progress {
        margin-bottom: 30px;
    } */
}

@media (max-width: 576px) {
    /* body {
        padding: 10px;
    } */

    .card {
        padding: 25px 20px;
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .card-header {
        /* margin-bottom: 20px;
        padding-bottom: 15px; */
    }

    .card-header h2 {
        font-size: 16px;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* .card-title {
        font-size: 18px;
    } */

    /* .header h1 {
        font-size: 22px;
    } */
}
