﻿/* ===== FABULA ARCANA - REGISTRATION PAGE CSS ===== */
/* Optimized for full-screen display without scrolling */

:root {
    --bg-primary: #0d0d1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(22, 33, 61, 0.95);
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-fuchsia: #c026d3;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --text-primary: #e5e5e5;
    --text-secondary: #a0a0a0;
    --text-accent: #c4b5fd;
    --border-color: rgba(124, 58, 237, 0.3);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #eab308;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body.registrazione-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
}

/* ===== VIDEO BACKGROUND ===== */
.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35) saturate(1.1);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at center, transparent 0%, rgba(13, 13, 26, 0.7) 100%),
        linear-gradient(180deg, rgba(13, 13, 26, 0.3) 0%, rgba(13, 13, 26, 0.6) 100%);
}

/* ===== MAIN WRAPPER ===== */
.registrazione-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== NAVIGATION BUTTONS ===== */
.back-button, .contact-link {
    position: fixed;
    top: 15px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-button {
    left: 15px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--accent-secondary);
    font-family: 'Cinzel', serif;
}

.back-button:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(124, 58, 237, 0.2));
    transform: translateX(-3px);
}

.contact-link {
    right: 15px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.contact-link:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

/* ===== CONTENT AREA ===== */
.registrazione-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 15px 15px;
}

/* ===== PRIVACY PHASE ===== */
.privacy-card {
    width: 100%;
    max-width: 750px;
    max-height: calc(100vh - 70px);
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(15, 15, 26, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 20px 25px;
    box-shadow: 0 0 50px rgba(124, 58, 237, 0.2), 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: cardAppear 0.5s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes cardAppear {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.privacy-header {
    text-align: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.privacy-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-secondary), #e879f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.privacy-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 5px;
}

.privacy-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 15px;
    min-height: 0;
}

.privacy-content::-webkit-scrollbar {
    width: 4px;
}

.privacy-content::-webkit-scrollbar-track {
    background: rgba(168, 85, 247, 0.1);
    border-radius: 2px;
}

.privacy-content::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 2px;
}

.privacy-section {
    margin-bottom: 15px;
}

.privacy-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.privacy-section p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.6;
    text-align: justify;
}

.privacy-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-privacy {
    flex: 1;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-decline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger);
}

.btn-decline:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-accept {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-fuchsia));
    border: none;
    color: #fff;
}

.btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.4);
}

/* ===== REGISTRATION PHASE ===== */
.registration-card {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 70px);
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(15, 15, 26, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 20px 25px;
    box-shadow: 0 0 60px rgba(124, 58, 237, 0.2), 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: cardSlideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.registration-header {
    text-align: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.registration-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-secondary), #e879f9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.registration-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 5px 0;
}

.registration-title::after {
    content: '?';
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: rgba(168, 85, 247, 0.5);
}

.registration-subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: none; /* Hide on small screens */
}

/* ===== FORM STYLES ===== */
.registration-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 5px;
}

.registration-form::-webkit-scrollbar {
    width: 3px;
}

.registration-form::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 2px;
}

.form-group {
    flex-shrink: 0;
}

.form-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(13, 13, 26, 0.6);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 0.85rem;
}

.form-input:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}

.form-input.valid { border-color: var(--success); }
.form-input.invalid { border-color: var(--danger); }

.form-feedback {
    margin-top: 4px;
    font-size: 0.7rem;
    min-height: 16px;
}

.form-feedback.valid { color: var(--success); }
.form-feedback.invalid { color: var(--danger); }
.form-feedback.checking { color: var(--text-secondary); }

/* Password strength */
.password-strength {
    margin-top: 6px;
}

.strength-bar-container {
    height: 4px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.password-match {
    margin-top: 4px;
    font-size: 0.7rem;
}

.password-match.match { color: var(--success); }
.password-match.no-match { color: var(--danger); }

/* ===== INFO NOTES - Compact ===== */
.info-notes {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.06), rgba(124, 58, 237, 0.03));
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    flex-shrink: 0;
}

.info-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.info-note:last-child { margin-bottom: 0; }

.info-note-icon {
    color: var(--accent-secondary);
    flex-shrink: 0;
    font-size: 0.65rem;
}

/* ===== SUBMIT BUTTON ===== */
.btn-register {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-fuchsia));
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 5px;
}

.btn-register:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

.btn-register:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== DIVIDER & LINKS ===== */
.registration-divider {
    display: flex;
    align-items: center;
    margin: 12px 0;
    gap: 10px;
    flex-shrink: 0;
}

.registration-divider::before,
.registration-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.3), transparent);
}

.registration-divider span {
    color: rgba(168, 85, 247, 0.4);
    font-size: 0.8rem;
}

.registration-links {
    text-align: center;
    flex-shrink: 0;
}

.registration-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    color: var(--text-accent);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.registration-link:hover {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(168, 85, 247, 0.1));
    border-color: var(--accent-secondary);
}

/* ===== VALIDATION ERRORS ===== */
.validation-summary-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--danger);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

/* ===== LOADING ===== */
.loading-spinner-small {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(168, 85, 247, 0.2);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== PHASE TOGGLE ===== */
.phase-hidden { display: none !important; }

/* ===== ENHANCED PRIVACY STYLES ===== */
.privacy-intro {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(124, 58, 237, 0.05));
    padding: 15px;
    border-radius: 10px;
    border-left: 3px solid var(--accent-secondary);
}

.privacy-section h3 .section-icon {
    margin-right: 8px;
    font-style: normal;
}

.privacy-link {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.privacy-link:hover {
    color: #e879f9;
    text-decoration: underline;
}

.age-warning {
    align-items: center;
    gap: 12px;
    background: rgb(159 8 234 / 10%);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgb(176 8 234 / 30%);
}

.warning-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}

.gdpr-note {
    font-style: italic;
    color: var(--text-accent) !important;
    font-size: 0.75rem !important;
    opacity: 0.9;
}

.free-notice {
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.05));
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e !important;
}

.free-icon {
    font-size: 1.2rem;
}

.privacy-declaration {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(124, 58, 237, 0.1));
    padding: 15px 18px;
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    margin-top: 15px;
}

.privacy-declaration p {
    color: var(--text-primary) !important;
    text-align: center;
    font-size: 0.85rem !important;
}

/* ===== CHECKBOX ACCEPTANCE ===== */
.privacy-acceptance {
    margin: 20px 0 15px;
    padding: 15px;
    background: rgba(15, 15, 26, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.acceptance-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.acceptance-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 6px;
    background: rgba(26, 26, 46, 0.8);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.checkbox-custom::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.acceptance-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-fuchsia));
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.acceptance-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.checkbox-label strong {
    color: var(--accent-secondary);
}

/* ===== ENHANCED BUTTONS ===== */
.btn-privacy .btn-icon {
    margin-right: 6px;
}

.btn-accept:disabled {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(192, 38, 211, 0.2));
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-accept:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ===== RESPONSIVE - Tablets ===== */
@media (min-height: 700px) {
    .registration-subtitle { display: block; }
    .registration-form { gap: 14px; }
    .form-input { padding: 12px 16px; }
    .btn-register { padding: 14px 24px; }
}

@media (min-height: 800px) {
    .registrazione-content { padding: 60px 20px 20px; }
    .registration-card { padding: 25px 30px; }
    .privacy-card { padding: 25px 30px; }
}

/* ===== RESPONSIVE - Mobile ===== */
@media (max-width: 480px) {
    .registrazione-content { padding: 45px 10px 10px; }
    
    .registration-card, .privacy-card {
        padding: 15px 18px;
        border-radius: 12px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .privacy-section p { font-size: 0.75rem; }
    .info-note { font-size: 0.65rem; }
    
    .btn-register, .btn-accept, .btn-decline {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* ===== RESPONSIVE - Very small screens ===== */
@media (max-height: 600px) {
    .registrazione-content { padding: 40px 10px 10px; }
    
    .registration-header, .privacy-header { margin-bottom: 10px; }
    .registration-logo, .privacy-logo { font-size: 1.1rem; }
    .registration-title, .privacy-title { font-size: 0.9rem; }
    
    .registration-form { gap: 8px; }
    .form-label { font-size: 0.7rem; margin-bottom: 3px; }
    .form-input { padding: 8px 10px; font-size: 0.85rem; }
    
    .info-notes { padding: 8px 10px; }
    .info-note { font-size: 0.6rem; margin-bottom: 4px; }
    
    .registration-divider { margin: 8px 0; }
    .btn-register { padding: 10px 16px; font-size: 0.85rem; }
}

/* ===== Large screens ===== */
@media (min-width: 1200px) and (min-height: 900px) {
    .registration-card { max-width: 450px; padding: 30px 35px; }
    .privacy-card { max-width: 800px; padding: 30px 35px; }
    .registration-form { gap: 16px; }
    .form-input { padding: 14px 18px; }
}
