/**
 * MIIO Studio Theme
 * Based on default theme with dark background from miio.studio/tag/
 */

:root {
    --primary: #E63946;
    --primary-hover: #d32f3e;
    --text: #1D3557;
    --muted: #6C757D;
    --bg: #FFFFFF;
    --bg-body: #1a1a1a;
    --border: #DEE2E6;
    --error: #dc3545;
    --success: #28a745;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #000000;
    background-image: linear-gradient(to bottom, rgb(29 29 29 / .2) 0%, rgb(29 29 29) 100%), url('../img/bg-miiostudio.jpg');
    background-repeat: no-repeat;
    background-position: center 60px;
    background-size: 100% auto;
    background-attachment: scroll;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .container {
        max-width: 90%;
        padding: 3rem 2rem;
    }
}

@media (min-width: 1024px) {
    .container {
        width: 1040px;
        max-width: 90%;
    }
}

/* Top Bar */
.top-bar {
    width: 100%;
    height: 60px;
    background: #07070A;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-bar a {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.top-bar a:hover {
    color: #ccc;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 40px 0;
}

header a {
    display: inline-block;
}

.logo {
    max-width: 280px;
    height: auto;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

/* Main Content */
main {
    flex: 1;
}

/* Card */
.card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.card:last-child {
    margin-bottom: 0;
}

/* Typography */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text);
}

.page-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Bilingual Text */
.bilingual .en {
    display: inline;
}

.bilingual .fr {
    display: inline;
    color: var(--muted);
    font-style: italic;
}

.bilingual .fr::before {
    content: " — ";
    font-style: normal;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg);
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

input::placeholder {
    color: #adb5bd;
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Errors */
.has-error input {
    border-color: var(--error);
}

.error-message {
    display: block;
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.error-message .fr {
    color: var(--error);
    opacity: 0.8;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fdf2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

/* Button */
.btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
    margin-top: 0.5rem;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

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

/* Confirmation Page */
.confirmation {
    text-align: center;
}

.confirmation-message {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Info Cards Row - 2 columns on desktop */
.info-cards-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-cards-row .card {
    margin-bottom: 0;
    flex: 1;
}

@media (min-width: 768px) {
    .info-cards-row {
        flex-direction: row;
        gap: 1.5rem;
    }
}

/* Sharing Notice Cards */
.sharing-notice-card {
    text-align: center;
}

.sharing-notice-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sharing-notice-card.sharing-notice-private {
    background: #fff8e6;
    border: 2px solid #f59e0b;
    color: #92400e;
}

.sharing-notice-card.sharing-notice-private .fr {
    color: #b45309;
}

.sharing-notice-card.sharing-notice-public {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #166534;
}

.sharing-notice-card.sharing-notice-public .fr {
    color: #15803d;
}

.guest-info {
    background: #f5f7fa;
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: left;
}

.guest-info p {
    margin-bottom: 0.5rem;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
}

footer p {
    font-size: 0.85rem;
    color: #888888;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .page-title {
        font-size: 1.15rem;
        line-height: 1.4;
    }
    
    .logo {
        max-width: 220px;
    }
    
    .bilingual .fr::before {
        content: " ";
    }
    
    .bilingual .fr {
        display: block;
        margin-top: 0.1rem;
    }
}

/* Photos Section */
.photos-section,
.no-photos {
    margin-top: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.section-title .photo-id-label {
    color: var(--muted);
    font-weight: 400;
}

.event-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.photo-item {
    display: block;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.photo-item:hover img {
    opacity: 0.9;
}

.no-photos {
    text-align: center;
}

.no-photos p {
    color: var(--muted);
}

@media (max-width: 400px) {
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* reCAPTCHA */
.recaptcha-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.5rem 0;
}

.recaptcha-group .g-recaptcha {
    transform-origin: center;
}

.recaptcha-group .error-message {
    text-align: center;
    margin-top: 0.75rem;
}

@media (max-width: 340px) {
    .recaptcha-group .g-recaptcha {
        transform: scale(0.9);
    }
}

/* Social Tag Notice */
.social-tag-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    text-align: center;
}

.social-tag-notice p {
    margin: 0;
    font-size: 0.95rem;
    color: #0369a1;
}

.social-tag-notice .fr {
    color: #0284c7;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #e0f2fe;
    color: #0369a1;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.social-link:hover {
    background: #bae6fd;
    transform: translateY(-1px);
}

.social-icon {
    font-size: 1.1rem;
}

svg.social-icon {
    width: 1.1rem;
    height: 1.1rem;
}

/* Download All Button */

.btn-download-all {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #b8bcc4;
    color: #374151;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-download-all:hover {
    background: #9ca3af;
    transform: translateY(-1px);
    color: #1f2937;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
    padding: 0.5rem;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    z-index: 1001;
    border-radius: 4px;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
}

#lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-actions {
    margin-top: 1rem;
}

.btn-download {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: #b8bcc4;
    color: #374151;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #9ca3af;
}

@media (max-width: 768px) {
    .lightbox-nav {
        padding: 0.75rem;
        font-size: 1.5rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary .bilingual .fr {
    color: rgba(255, 255, 255, 0.85);
}

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

.btn-secondary {
    background: #374151;
    color: #e5e7eb;
}

.btn-secondary .bilingual .fr {
    color: #9ca3af;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-change-consent {
    margin-top: 1rem;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.btn-consent-public {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.btn-consent-public:hover {
    background: #bbf7d0;
}

.btn-consent-private {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.btn-consent-private:hover {
    background: #fde68a;
}

/* ==========================================================================
   Consent Change Modal
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: #1D3557;
    display: flex;
    flex-direction: column;
}

.modal-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    padding: 1.5rem 2rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 1;
}

.modal-body {
    padding: 0 2rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #6C757D;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
}

.modal-close:hover {
    color: #1D3557;
}

.modal-title {
    color: #1D3557;
    font-size: 1.5rem;
    margin: 0;
}

#consent-modal-body p {
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.consent-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

.consent-warning p {
    color: #92400e;
    margin: 0;
}

#consent-send-btn {
    margin-top: 1.5rem;
}

#consent-modal-success {
    padding: 1rem 0;
}

#consent-modal-success .success-icon {
    width: 60px;
    height: 60px;
    background: #10B981;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

#consent-modal-success h3 {
    color: #10B981;
    margin: 0 0 0.5rem 0;
}

#consent-modal-success p {
    color: #4B5563;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .modal-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .modal-body {
        padding: 0 1rem 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}
