:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #4cc9f0;
    --accent-color: #f72585;
    --text-color: #2b2d42;
    --text-light: #6b7280;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --success-color: #10b981;
    --error-color: #ef4444;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Heebo', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f1 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 480px;
    position: relative;
    min-height: 500px;
}

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    animation: fadeSlideIn 0.5s ease-out;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

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

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

.card.fade-out {
    animation: fadeSlideOut 0.4s ease-out forwards;
}

.card.fade-in {
    animation: fadeSlideIn 0.5s ease-out forwards;
}

h2 {
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Instructions Section */
.instructions-text {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.instructions-text ul {
    padding-right: 1.5rem;
    margin-top: 0.75rem;
}

.instructions-text li {
    margin-bottom: 0.5rem;
}

.video-link {
    margin-bottom: 1.5rem;
}

.video-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    background: rgba(67, 97, 238, 0.08);
    transition: var(--transition);
}

.video-link a:hover {
    background: rgba(67, 97, 238, 0.15);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-container label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    user-select: none;
}

/* Video Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-bg);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.close-btn:hover {
    background: #e9ecef;
    color: var(--text-color);
}

.video-wrapper {
    margin: 1rem 0 1.5rem;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    display: block;
    max-height: 60vh;
    object-fit: contain;
}

.video-checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
}

.video-checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.video-checkbox-container label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
}

/* Form Section */
#formSection {
    padding-top: 3rem;
}

.back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--light-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-light);
    z-index: 5;
}

.back-btn:hover {
    background: #e9ecef;
    color: var(--text-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius-sm);
    background: var(--white);
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input:disabled,
.form-group input[readonly] {
    background: #f0f0f0;
    cursor: not-allowed;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-primary:disabled {
    background: #aab;
    cursor: not-allowed;
    transform: none;
}

.btn-google {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--white);
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.btn-google:hover:not(:disabled) {
    background: var(--light-bg);
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.btn-google .google-icon {
    flex-shrink: 0;
}

/* Messages */
.error-message {
    color: var(--error-color);
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: none;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--border-radius-sm);
}

.error-message.show {
    display: block;
}

/* Result Page */
.result-icon {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-icon svg {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

.result-message {
    color: var(--text-light);
    font-size: 1.05rem;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.user-info {
    background: var(--light-bg);
    border-radius: var(--border-radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.user-info p {
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.user-info p:last-child {
    margin-bottom: 0;
}

.user-info strong {
    color: var(--text-color);
    font-weight: 600;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
}

/* Info Box */
.info-box {
    background: var(--light-bg);
    padding: 1.25rem;
    border-radius: var(--border-radius-sm);
    border-right: 4px solid var(--primary-color);
    margin: 1.5rem 0;
}

.info-box.success {
    background: rgba(16, 185, 129, 0.1);
    border-right-color: var(--success-color);
}

.info-box p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Loading Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 16px;
        align-items: center;
    }

    .container {
        min-height: auto;
    }

    .card {
        position: relative;
        padding: 1.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }

    .video-wrapper video {
        max-height: 45vh;
    }

    .form-group input {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn-google {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .back-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    #formSection {
        padding-top: 2.5rem;
    }
}

@media (max-width: 380px) {
    .card {
        padding: 1.25rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .checkbox-container,
    .video-checkbox-container {
        padding: 0.75rem;
        gap: 10px;
    }

    .btn-google span {
        font-size: 0.9rem;
    }
}
