/*--------------------------------------------------------------
# Registration Form Styles
--------------------------------------------------------------*/

/* Flatpickr Calendar - ให้แสดงเหนือ elements อื่น */
.flatpickr-calendar {
    z-index: 99999 !important;
}

.flatpickr-calendar.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Buddhist Year Dropdown */
.be-year-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    color: inherit;
    padding: 0 5px;
    cursor: pointer;
}

.be-year-select:focus {
    outline: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes progressPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(var(--accent-color-rgb), 0);
    }
}

.registration-form-container {
    background: var(--surface-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.5s ease-out;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    padding: 0 20px;
}

.progress-steps::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: color-mix(in srgb, var(--default-color), transparent 85%);
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.step-item:hover {
    transform: translateY(-2px);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--default-color), transparent 85%);
    color: var(--default-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--default-color), transparent 40%);
    text-align: center;
    transition: all 0.3s ease;
}

.step-item.active .step-number,
.step-item.completed .step-number {
    background: var(--accent-color);
    color: var(--contrast-color);
}

.step-item.active .step-number {
    animation: progressPulse 2s infinite;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--accent-color);
    font-weight: 600;
}

.step-item.completed .step-number::after {
    content: none;
}

/* Form Steps */
.form-step {
    display: none;
    opacity: 0;
}

.form-step.active {
    display: block;
    animation: fadeInScale 0.4s ease forwards;
}

.step-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 85%);
}

.step-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 8px;
}

.step-header p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Form Controls */
.registration-form .form-label {
    font-weight: 600;
    color: var(--heading-color);
    margin-bottom: 8px;
}

.registration-form .form-control,
.registration-form .form-select {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid color-mix(in srgb, var(--default-color), transparent 80%);
    background-color: var(--surface-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.registration-form .form-control:focus,
.registration-form .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color), transparent 80%);
    transform: translateY(-1px);
}

.registration-form .form-control::placeholder {
    color: color-mix(in srgb, var(--default-color), transparent 60%);
}

.registration-form .form-text {
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--default-color), transparent 40%);
    margin-top: 5px;
}

/* File Input */
.registration-form input[type="file"] {
    padding: 10px 12px;
}

.registration-form input[type="file"]::file-selector-button {
    background: var(--accent-color);
    color: var(--contrast-color);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.registration-form input[type="file"]::file-selector-button:hover {
    background: color-mix(in srgb, var(--accent-color), #000 15%);
}

/* Summary Section */
.summary-section {
    background: color-mix(in srgb, var(--accent-color), transparent 95%);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid color-mix(in srgb, var(--accent-color), transparent 80%);
    animation: slideIn 0.4s ease;
}

.summary-section h4 {
    color: var(--heading-color);
    font-weight: 700;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--default-color), transparent 80%);
    transition: background 0.2s ease;
}

.summary-item:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    margin-right: -10px;
    border-radius: 5px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-weight: 600;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
}

.summary-item .value {
    color: var(--heading-color);
    font-weight: 500;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
}

.form-navigation .btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-navigation .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.form-navigation .btn:active::after {
    width: 200px;
    height: 200px;
}

.form-navigation .btn-prev {
    background: transparent;
    border: 2px solid color-mix(in srgb, var(--default-color), transparent 70%);
    color: var(--default-color);
}

.form-navigation .btn-prev:hover {
    background: color-mix(in srgb, var(--default-color), transparent 90%);
    border-color: var(--default-color);
    transform: translateX(-3px);
}

.form-navigation .btn-next,
.form-navigation .btn-submit {
    background: var(--accent-color);
    color: var(--contrast-color);
    border: none;
    margin-left: auto;
}

.form-navigation .btn-next:hover,
.form-navigation .btn-submit:hover {
    background: color-mix(in srgb, var(--accent-color), #000 15%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.form-navigation .btn-submit {
    background: #28a745;
}

.form-navigation .btn-submit:hover {
    background: #218838;
}

/* Checkbox */
.registration-form .form-check-input {
    width: 20px;
    height: 20px;
    margin-top: 0;
}

.registration-form .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.registration-form .form-check-label {
    margin-left: 8px;
    line-height: 1.5;
}

/* Responsive */

/* Large Tablets and Small Desktops */
@media (max-width: 992px) {
    .registration-form-container {
        padding: 30px;
        border-radius: 15px;
    }

    .progress-steps {
        padding: 0 10px;
    }

    .progress-steps::before {
        left: 40px;
        right: 40px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .step-label {
        font-size: 0.8rem;
    }

    .step-header h3 {
        font-size: 1.35rem;
    }

    .registration-form .form-control,
    .registration-form .form-select {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}

/* Tablets and Mobile */
@media (max-width: 768px) {
    .registration-form-container {
        padding: 20px 15px;
        border-radius: 12px;
    }

    /* Progress Steps - Horizontal Scroll on Mobile */
    .progress-steps {
        padding: 0;
        margin-bottom: 25px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 5px;
    }

    .progress-steps::-webkit-scrollbar {
        display: none;
    }

    .progress-steps::before {
        left: 30px;
        right: 30px;
        top: 18px;
        height: 2px;
    }

    .step-item {
        min-width: 70px;
        flex-shrink: 0;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .step-label {
        font-size: 0.7rem;
        max-width: 60px;
        line-height: 1.2;
    }

    .step-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .step-header h3 {
        font-size: 1.15rem;
    }

    .step-header p {
        font-size: 0.9rem;
    }

    .registration-form .form-label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .registration-form .form-control,
    .registration-form .form-select {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
    }

    .registration-form .form-text {
        font-size: 0.8rem;
    }

    .registration-form input[type="file"]::file-selector-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .summary-section {
        padding: 15px;
        border-radius: 12px;
    }

    .summary-section h4 {
        font-size: 1.1rem;
    }

    .summary-item {
        flex-direction: column;
        gap: 3px;
        padding: 8px 0;
        font-size: 0.9rem;
    }

    .form-navigation {
        flex-direction: column;
        gap: 12px;
        padding-top: 15px;
    }

    .form-navigation .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .form-navigation .btn-next,
    .form-navigation .btn-submit {
        margin-left: 0;
        order: -1;
    }

    .form-navigation .btn-prev {
        order: 1;
    }
}

/* Mobile Phones */
@media (max-width: 576px) {
    .page-title h1 {
        font-size: 1.5rem;
    }

    .registration-form-container {
        padding: 15px 12px;
        border-radius: 10px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    }

    /* Progress Steps - Compact on Small Mobile */
    .progress-steps {
        justify-content: flex-start;
        padding: 0 5px;
        gap: 3px;
    }

    .step-item {
        min-width: 60px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .step-label {
        font-size: 0.65rem;
        max-width: 55px;
    }

    .step-header h3 {
        font-size: 1.1rem;
    }

    .step-header h3 i {
        font-size: 1rem;
    }

    .step-header p {
        font-size: 0.85rem;
    }

    .registration-form .form-label {
        font-size: 0.85rem;
    }

    .registration-form .form-control,
    .registration-form .form-select {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .registration-form input[type="file"] {
        font-size: 0.85rem;
    }

    .registration-form input[type="file"]::file-selector-button {
        padding: 5px 10px;
        font-size: 0.8rem;
        margin-right: 8px;
    }

    .summary-section h4 {
        font-size: 1rem;
    }

    .registration-form .form-check-input {
        width: 18px;
        height: 18px;
    }

    .registration-form .form-check-label {
        font-size: 0.85rem;
    }

    .form-navigation .btn {
        padding: 11px 16px;
        font-size: 0.9rem;
        border-radius: 30px;
    }
}

/* Print styles */
@media print {
    .registration-form-container {
        box-shadow: none;
        padding: 20px;
    }

    .progress-steps-wrapper,
    .form-navigation {
        display: none;
    }

    .form-step {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 30px;
    }
}
