/* ============================================
   UGC Creator Consent Form - Stylesheet
   ============================================ */

/* --- Font: Playfair Display (Google Fonts) --- */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f1f5f9 50%, #ecfdf5 100%);
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Layout --- */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
    position: relative;
}

/* --- Header --- */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 2.1rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.625rem;
    letter-spacing: -0.01em;
}

.header-subtitle {
    color: #64748b;
    font-size: 1rem;
}

/* --- Progress Bar --- */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.step-check {
    display: none;
    font-size: 1.1rem;
}

.progress-step.active .step-circle {
    background: #1e40af;
    border-color: #1e40af;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}

.progress-step.completed .step-circle {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

.progress-step.completed .step-number {
    display: none;
}

.progress-step.completed .step-check {
    display: inline;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.progress-step.active .step-label {
    color: #1e40af;
}

.progress-step.completed .step-label {
    color: #059669;
}

.progress-line {
    flex: 1;
    height: 2.5px;
    background: #e2e8f0;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    max-width: 80px;
    border-radius: 2px;
}

.progress-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #059669;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.progress-line.filled .progress-line-fill {
    width: 100%;
}

/* --- Form Steps --- */
.form-step {
    display: none;
    background: #ffffff;
    border-radius: 16px;
    padding: 2.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.form-step.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

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

/* --- Step Header --- */
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.step-header-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e40af;
}

.step-header h2 {
    margin-bottom: 0.125rem;
}

.step-header .step-description {
    margin-bottom: 0;
}

.form-step h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.step-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* --- Fieldsets --- */
.form-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.form-fieldset legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid #f1f5f9;
    width: 100%;
}

.optional-tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

/* --- Form Row (side by side) --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.375rem;
}

.required-mark {
    color: #dc2626;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    font-size: 0.95rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: default;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #dc2626;
    background: #fef2f2;
}

.form-group input.error:focus,
.form-group textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background: #fff;
}

.form-group input.valid {
    border-color: #059669;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.field-error {
    display: block;
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.25rem;
    min-height: 1.2em;
}

/* --- Radio Buttons --- */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex !important;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    font-weight: 400 !important;
    color: #1e293b !important;
    font-size: 0.9rem !important;
    line-height: 1.5;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: #fff;
}

.radio-label:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.radio-mark::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.radio-label input[type="radio"]:checked ~ .radio-mark {
    border-color: #1e40af;
}

.radio-label input[type="radio"]:checked ~ .radio-mark::after {
    background: #1e40af;
    opacity: 1;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: #1e40af;
    background: #eff6ff;
}

.radio-label input[type="radio"]:focus-visible ~ .radio-mark {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

/* --- Conditional Section --- */
.conditional-section {
    display: none;
    margin-top: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    animation: fadeIn 0.35s ease;
}

.conditional-section.visible {
    display: block;
}

.conditional-note {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* --- Checkbox --- */
.checkbox-group {
    margin-top: 1.25rem;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    font-weight: 400 !important;
    color: #1e293b !important;
    font-size: 0.9rem !important;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.checkmark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #1e40af;
    border-color: #1e40af;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.checkbox-label input[type="checkbox"]:focus-visible + .checkmark {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

/* --- Agreement --- */
.agreement-container {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    max-height: 420px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.agreement-text {
    padding: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #334155;
}

.agreement-text h3 {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1.25rem;
    color: #0f172a;
    font-weight: 700;
}

.agreement-text h4 {
    font-size: 0.95rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
    font-weight: 700;
}

.agreement-text p {
    margin-bottom: 0.625rem;
}

.agreement-text ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
}

.agreement-text ul li {
    margin-bottom: 0.375rem;
}

.scroll-notice {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    transition: opacity 0.3s ease;
}

.scroll-notice.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-arrow {
    display: inline-block;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* --- Signature Pad --- */
.signature-pad-wrapper {
    position: relative;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    touch-action: none;
}

.signature-pad-wrapper canvas {
    width: 100%;
    height: 180px;
    display: block;
    cursor: crosshair;
}

.signature-line {
    position: absolute;
    bottom: 40px;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: #cbd5e1;
    pointer-events: none;
}

.signature-pad-wrapper.error {
    border-color: #dc2626;
    background: #fef2f2;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn svg {
    flex-shrink: 0;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: #1e40af;
    color: #fff;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.25);
}

.btn-primary:hover {
    background: #1e3a8a;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(30, 64, 175, 0.2);
}

.btn-submit-final {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

.btn-submit-final:hover {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
}

.btn-secondary {
    background: #fff;
    color: #475569;
    border: 1.5px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-text {
    background: none;
    color: #64748b;
    font-size: 0.825rem;
    padding: 0.375rem 0;
    font-weight: 500;
}

.btn-text:hover {
    color: #1e40af;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1.5px solid #f1f5f9;
}

/* --- Confirmation --- */
.confirmation {
    text-align: center;
    padding: 1rem 0;
}

.confirmation-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
    font-size: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-weight: 700;
    box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.1);
}

.confirmation h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.65rem;
    font-weight: 700;
}

.confirmation-message {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.confirmation-details {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    text-align: left;
}

.confirmation-details h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.detail-row:not(:last-child) {
    border-bottom: 1px solid #e2e8f0;
}

.detail-label {
    font-weight: 600;
    color: #475569;
}

.detail-value {
    color: #1e293b;
}

/* --- Loading Overlay --- */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}

.loading-overlay.active {
    display: flex;
}

.loading-overlay p {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .container {
        padding: 1.25rem 0.875rem 2rem;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .form-step {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
    }

    .step-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .step-label {
        font-size: 0.6rem;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .progress-line {
        max-width: 44px;
    }

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

    .agreement-container {
        max-height: 300px;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.125rem;
    }
}
