* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    min-height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../image/background.png') center center/cover no-repeat;
    filter: brightness(0.8);
    z-index: -1;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mobile-only-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
}

.mobile-only-message.hidden {
    display: none;
}

.mobile-only-message .message-content {
    max-width: 500px;
    padding: 30px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.mobile-only-message h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #ffcc00;
}

.mobile-only-message p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 15px;
}
.noscript-message {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #f8d7da; color: #721c24;
    display: flex; align-items: center; justify-content: center;
    text-align: center; z-index: 10000;
    font-family: 'Inter', sans-serif; font-size: 1.5em;
    padding: 20px; box-sizing: border-box;
}

.main-container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 4rem);
    height: 100vh;
    overflow: hidden;
    padding: 1rem;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    animation: fadeInDown 0.8s ease;
}

.header-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
}

.header-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    max-width: 500px;
    max-height: 90vh; /* Adjust this value as needed */
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    height: 70vh;
    max-height: 600px; 
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.form-card::-webkit-scrollbar {
    width: 6px;
}

.form-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.form-card::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.form-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
}

.error-display,
.success-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 500;
    animation: slideInFromTop 0.3s ease;
}

.error-display {
 background: rgba(255, 92, 92, 0.15);
    border: 1px solid rgba(255, 60, 60, 0.3);
    color: #ff1e1ef5;
}

.success-display {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #00ff5e;
}

.error-display.hidden,
.success-display.hidden {
    display: none;
}

.error-icon,
.success-icon {
    font-size: 1.5rem;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    font-weight: 300;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.form-label {
    display: block;
    font-weight: 500;
    color: white;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-input,
.form-select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 400;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-input:valid,
.form-select:valid {
    border-color: rgba(34, 197, 94, 0.5);
}

.form-select option {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem;
}

.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.otp-input {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5rem;
}

.form-focus-line {
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.form-input:focus + .form-focus-line,
.form-select:focus + .form-focus-line {
    width: 100%;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.btn {
    position: relative;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading.hidden {
    display: none;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.privacy-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.privacy-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.privacy-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.privacy-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 10;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.celebration-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-100px) rotate(180deg); }
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem 0 90px 0;
    }

    .header-content {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .header-title {
        font-size: 2rem;
    }

    .form-container {
        padding: 1rem 0.5rem;
        min-height: auto;
        flex: 1;
    }

    .form-card {
        padding: 2rem;
        border-radius: 20px;
        max-height: calc(100vh - 250px);
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: row;
        gap: 1rem;
    }

    .btn-secondary,
    .btn-primary {
        flex: 1;
    }

    .form-card {
        padding: 2rem;
        max-height: 90vh;
    }
    
    .form-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .main-container {
        padding: 1rem 0.5rem 100px 0.5rem;
        min-height: 100vh;
    }

    .header {
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    .header-content {
        padding: 1rem;
        border-radius: 12px;
    }

    .header-title {
        font-size: 1.8rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .form-container {
        padding: 0.5rem;
        min-height: auto;
        flex: 1;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 1rem;
    }

    .form-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
        max-height: calc(100vh - 200px);
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .section-subtitle {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .form-input,
    .form-select {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 1.25rem;
    }
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        border-radius: 10px;
        min-height: 50px;
    }

    .otp-input {
        font-size: 1.25rem;
        letter-spacing: 0.25rem;
        text-align: center;
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .btn-secondary {
        width: 100%;
        order: 2;
    }

    .btn-primary {
        width: 100%;
        order: 1;
    }

    .error-display,
    .success-display {
        padding: 0.875rem 1rem;
        border-radius: 10px;
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
    }

    .privacy-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    .privacy-text {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .footer {
        padding: 0.75rem;
        font-size: 0.8rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .form-card {
        padding: 1.5rem;
        max-height: 95vh;
    }
    
    .form-card {
        padding: 1rem;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        background-size: cover;
        background-attachment: scroll;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    .form-card {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .header-content {
        background: rgba(0, 0, 0, 0.2);
    }
}

@media (max-height: 600px) {
    .form-container {
        max-height: 95vh;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    .form-card {
        padding: 1.5rem;
    }
}