/* Fonts personnalisées */
@font-face {
    font-family: 'Queulat';
    src: url('../fonts/Queulat-Medium.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Queulat';
    src: url('../fonts/Queulat-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Maritime Champion';
    src: url('../fonts/MaritimeChampion-RegularSt.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

:root {
    --primary-color: #e31d1a;
    --primary-dark: #c01815;
    --secondary-color: #FFFFFF;
    --gold-color: #c5a44e;
    --gold-dark: #a8893d;
    --grey-light-color: #f0f0f0;
    --grey-medium: #e0e0e0;
    --text-dark: #1a1a1a;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Queulat', 'Georgia', 'Times New Roman', serif;
    background: #e8e8e8;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

/* Container principal - format téléphone */
.phone-container {
    width: 680px;
    max-width: 100%;
    background: var(--secondary-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

/* ========================================
   PAGE 1 - ÉCRAN D'ACCUEIL
   ======================================== */
.home-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 680 / 1000;
    overflow: hidden;
    background-image: url('../images/Front.png');
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #FFF;
    opacity: 1;
    transition: opacity 0.4s ease-out;
}

/* Effet de lumière sur le fond - bande fine diagonale */
.home-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.12) 45%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.12) 55%,
        transparent 60%
    );
    transform: skewX(-15deg);
    animation: shineBackground 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes shineBackground {
    0% {
        left: -100%;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    40% {
        left: 150%;
        opacity: 1;
    }
    45%, 100% {
        left: 150%;
        opacity: 0;
    }
}

.home-screen.hiding {
    opacity: 0;
}

.home-screen.showing {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Zone formulaire */
.form-overlay {
    position: absolute;
    top: 68%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 25px;
    width: 85%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideUpFade 0.6s ease-out;
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.form-row {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.input-label {
    display: inline-block;
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 400;
    text-align: center;
    font-family: 'Queulat', serif;
}

.year-input {
    flex: 3;
    padding: 10px 16px;
    font-size: 1.75rem;
    border: 1px solid var(--primary-color);
    text-align: center;
    font-weight: 400;
    color: var(--text-dark);
    background: var(--secondary-color);
    font-family: 'Queulat', serif;
    outline: none;
    transition: all 0.3s ease;
    min-width: 0;
}

.year-input:focus {
    border-left: 10px solid var(--primary-color);
    box-shadow: none;
}

.year-input::placeholder {
    color: #999;
    font-family: 'Queulat', serif;
}

.btn-discover {
    position: relative;
    padding: 10px 32px;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--secondary-color);
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Queulat', serif;
    white-space: nowrap;
    flex: 3;
    overflow: hidden;
}

/* Effet de reflet sur le bouton - bande fine */
.btn-discover::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    opacity: .7;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.0) 10%, rgba(255, 255, 255, 0.85) 60%, rgba(255, 255, 255, 0.0) 90%, transparent 100%);
    transform: skewX(-40deg);
    animation: shineButton 14s cubic-bezier(0.55, 0.09, 0.68, 0.53) infinite;
}

@keyframes shineButton {
    0% {
        right: -100%;
        opacity: 0;
    }
    1.5% {
        opacity: 0;
    }
    14% {
        opacity: 0.75;
    }
    8%, 20% {
        opacity: 0.25;
    }
    28.5% {
        right: 125%;
        opacity: 0;
    }
    28.6%, 100% {
        right: -100%;
        opacity: 0;
    }
}

.btn-discover:hover {
    background: var(--primary-dark);
}

/* Note en bas du formulaire */
.footer-note-home {
    margin-top: 12px;
    font-size: 10px;
    color: #666;
    line-height: 1.4;
    text-align: center;
    font-family: 'Queulat', serif;
}

/* Message d'erreur page 1 */
.error-message {
    display: none;
    background: #fed7d7;
    color: #c53030;
    padding: 10px;
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    font-family: 'Queulat', serif;
}

.error-message.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   PAGE 2 - ÉCRAN DE RÉSULTAT
   ======================================== */
.result-screen {
    display: none;
    padding: 45px 40px;
    padding-bottom: 60px;
    position: relative;
    z-index: 1;
    opacity: 0;
}

.result-screen.active {
    display: block;
    animation: fadeInSlide 0.5s ease-out forwards;
}

@keyframes fadeInSlide {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Info icon */
.info-icon {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary-color);
    font-family: 'Queulat', serif;
    z-index: 10;
}

.info-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.result-title {
    font-size: 20px;
    color: #4a5568;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 400;
    font-family: 'Queulat', serif;
    padding-right: 50px;
}

.word-display {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 60px 30px;
    text-align: center;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(227, 29, 26, 0.25);
    animation: wordReveal 0.8s ease-out;
    overflow: hidden;
}

/* Effet de reflet diagonal sur la carte - déclenché par classe JS */
.word-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.15) 45%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.15) 55%,
        transparent 65%
    );
    transform: skewX(-15deg);
    pointer-events: none;
}

/* Animation déclenchée uniquement via la classe .shine */
.word-display.shine::before {
    animation: cardShine 0.8s ease-out forwards;
}

@keyframes cardShine {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        left: 200%;
        opacity: 0;
    }
}

.word-display:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(227, 29, 26, 0.35);
}

.word {
    font-size: 52px;
    font-weight: bold;
    color: var(--secondary-color);
    letter-spacing: 3px;
    margin-bottom: 8px;
    font-family: 'Queulat', serif;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    -o-hyphens: auto;
    hyphens: auto;
}

.word-glose {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 300;
    font-family: 'Queulat', serif;
    font-style: italic;
    margin-top: 8px;
    display: none;
}

.word-year {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    font-family: 'Queulat', serif;
    margin-top: 10px;
}

.definition-link {
    text-align: center;
    margin-bottom: 35px;
    font-size: 15px;
    color: #4a5568;
    font-family: 'Queulat', serif;
}

.definition-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-family: 'Queulat', serif;
}

.definition-link a:hover {
    color: var(--primary-dark);
}

.definition-link i {
    font-size: 12px;
    margin-left: 4px;
}

.privacy-link {
    color: #666 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.3s ease !important;
    font-family: 'Queulat', serif !important;
    font-size: 0.75em !important;
    border-bottom: #666 !important;
}

.privacy-link:hover {
    color: var(--primary-dark) !important;
    border-bottom: 1px solid var(--primary-color) !important;
}

/* Partage */
.share-section {
    margin-bottom: 35px;
}

.share-toggle {
    width: 100%;
    padding: 16px;
    background: #fdeaea;
    color: var(--primary-color);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Queulat', serif;
}

.share-toggle:hover {
    background: #f9d4d4;
}

.share-toggle i {
    font-size: 18px;
}

.share-buttons {
    display: none;
    gap: 10px;
    margin-top: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.share-buttons.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.share-btn {
    flex: 1;
    padding: 14px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Queulat', serif;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn i {
    font-size: 16px;
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn.twitter {
    background: #000000;
    color: white;
}

.share-btn.download {
    background: #48bb78;
    color: white;
}

.share-btn.copylink {
    background: #718096;
    color: white;
}

.share-btn.copylink #copyLinkText {
    font-size: 0.8em;
}

/* Feedback email */
.email-feedback {
    display: none;
    font-size: 13px;
    padding: 8px 12px;
    margin-top: 10px;
    border-radius: 6px;
    font-family: 'Queulat', serif;
    text-align: center;
}

.email-feedback.success {
    background: #c6f6d5;
    color: #276749;
}

.email-feedback.error {
    background: #fed7d7;
    color: #9b2c2c;
}

/* Message de succès permanent */
.email-success-message {
    display: none;
    font-size: 15px;
    padding: 16px 20px;
    margin-top: 10px;
    border-radius: 8px;
    font-family: 'Queulat', serif;
    text-align: center;
    background: #c6f6d5;
    color: #276749;
    font-weight: 500;
}

.email-success-message i {
    margin-right: 8px;
    font-size: 18px;
}

/* Section email */
.email-section {
    background: var(--grey-light-color);
    padding: 28px;
    margin-bottom: 30px;
}

.email-text {
    font-size: 14px;
    color: #2d3748;
    line-height: 1.6;
    margin-bottom: 16px;
    font-family: 'Queulat', serif;
}

.email-text a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
}

.email-text a:hover {
    color: var(--primary-dark);
}

.email-input-group {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.email-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: white;
    font-size: 14px;
    transition: box-shadow 0.3s ease;
    font-family: 'Queulat', serif;
    min-width: 0;
}

.email-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(227, 29, 26, 0.15);
}

.email-input::placeholder {
    font-family: 'Queulat', serif;
}

.btn-validate {
    padding: 14px 28px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Queulat', serif;
}

.btn-validate:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 29, 26, 0.3);
}

/* Boutons secondaires */
.secondary-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.btn-secondary {
    flex: 1;
    padding: 16px;
    border: none;
    background: #fdeaea;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Queulat', serif;
}

.btn-secondary:hover {
    background: #f9d4d4;
    transform: translateY(-1px);
}

/* Encart promo */
.promo-box {
    background: #f5f5f5;
    padding: 20px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.promo-logo {
    flex-shrink: 0;
    width: 130px;
    height: 120px;
}

.promo-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.promo-content {
    flex: 1;
    text-align: left;
}

.promo-title {
    font-size: 16px;
    font-weight: 700;
    color: #E30613;
    margin-bottom: 8px;
    font-family: 'Queulat', serif;
}

.promo-text {
    font-size: 13px;
    color: #333333;
    margin-bottom: 12px;
    line-height: 1.4;
    font-family: 'Queulat', serif;
}

.btn-promo {
    padding: 10px 24px;
    background: #E30613;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-family: 'Queulat', serif;
}

.btn-promo:hover {
    background: #c00511;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

.datations-note {
    font-size: 12px;
    color: #666666;
    text-align: center;
    margin-top: 15px;
    line-height: 1.4;
    font-style: italic;
    padding: 0 20px;
    font-family: 'Queulat', serif;
}

/* Animations */
@keyframes wordReveal {
    0% {
        opacity: 0;
        transform: scale(0.9) rotateY(20deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0);
    }
}

/* Modale info */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border-radius: 12px;
    animation: fadeIn 0.3s ease-out;
}

.modal-close {
    position: sticky;
    top: 0;
    float: right;
    margin-top: -10px;
    margin-right: -10px;
    font-size: 28px;
    cursor: pointer;
    color: #718096;
    transition: color 0.3s ease;
}

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

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #1a365d;
    margin-bottom: 20px;
    font-family: 'Queulat', serif;
}

.modal-text {
    font-size: 15px;
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 11px;
    font-family: 'Queulat', serif;
}

.modal-text strong {
    color: #1a365d;
}

.modal-text a, .modal-text a:link, .modal-text a:visited, .modal-text a:hover, .modal-text a:active {
    color: #1a365d;
    text-decoration: underline solid 1px;
}

.copyright {
    text-align: center;
    margin-top: 1.25rem;
}

.technical-blue {
    text-align: center;
    font-size: small;
    padding-top: 0.75rem;
}

.technical-blue a, .technical-blue a:link, .technical-blue a:visited, .technical-blue a:hover, .technical-blue a:active {
    color: #1a365d73;
    text-decoration: underline solid 1px;
}


/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablette */
@media (max-width: 720px) {
    body {
        padding: 0;
        background: #FFF;
        align-items: flex-start;
    }

    .phone-container {
        width: 100%;
        box-shadow: none;
    }
}

/* Smartphone */
@media (max-width: 480px) {
    body {
        padding: 0;
        background: #FFF;
    }

    .phone-container {
        width: 100%;
        box-shadow: none;
    }

    /* Page 1 */
    .home-screen {
        height: auto;
        aspect-ratio: auto;
        min-height: 100vh;
        min-height: 100dvh;
        background-size: contain;
        /* background-position: center;*/
    }

    .form-overlay {
        top: 57%;
        /* bottom: 0; */
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        padding: 16px 20px;
        /* box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1); */
        animation: slideUpMobile 0.6s ease-out;
    }

    @keyframes slideUpMobile {
        0% {
            opacity: 0;
            transform: translateY(30px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .input-label {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .year-input {
        font-size: 1.3rem;
        padding: 8px 10px;
    }

    .btn-discover {
        font-size: 1rem;
        padding: 8px 16px;
    }

    .footer-note-home {
        font-size: 9px;
        margin-top: 8px;
    }

    .error-message {
        font-size: 12px;
        padding: 8px;
    }

    /* Page 2 */
    .result-screen {
        padding: 30px 20px;
        padding-bottom: 40px;
    }

    .info-icon {
        top: 20px;
        right: 20px;
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .result-title {
        font-size: 16px;
        margin-bottom: 20px;
        padding-right: 40px;
    }

    .word-display {
        padding: 40px 20px;
    }

    .word {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .word-glose {
        font-size: 14px;
        margin-top: 6px;
    }

    .word-year {
        font-size: 18px;
    }

    .definition-link {
        font-size: 13px;
        margin-bottom: 25px;
    }

    .secondary-buttons {
        gap: 8px;
        margin-bottom: 20px;
    }

    .btn-secondary {
        padding: 12px 8px;
        font-size: 12px;
    }

    .share-section {
        margin-bottom: 25px;
    }

    .share-toggle {
        padding: 12px;
        font-size: 14px;
    }

    .share-btn {
        padding: 10px;
        font-size: 11px;
        gap: 5px;
    }

    .email-section {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .email-text {
        font-size: 12px;
        line-height: 1.5;
    }

    .email-input-group {
        gap: 8px;
        margin-top: 12px;
    }

    .email-input {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-validate {
        padding: 10px 16px;
        font-size: 13px;
    }

    .promo-box {
        padding: 16px;
        gap: 12px;
    }

    .promo-logo {
        width: 90px;
        height: 85px;
    }

    .promo-title {
        font-size: 14px;
    }

    .promo-text {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .btn-promo {
        padding: 8px 16px;
        font-size: 12px;
    }

    .datations-note {
        font-size: 10px;
        padding: 0 10px;
        margin-top: 12px;
    }

    /* Modale */
    .modal-content {
        padding: 24px;
        margin: 10px;
        max-height: 80vh;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-text {
        font-size: 13px;
        line-height: 1.6;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    .input-label {
        font-size: 0.95rem;
    }

    .year-input {
        font-size: 1.1rem;
    }

    .btn-discover {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .word {
        font-size: 28px;
    }

    .word-glose {
        font-size: 12px;
        margin-top: 5px;
    }

    .word-year {
        font-size: 16px;
    }

    .result-title {
        font-size: 13px;
    }
}
