﻿/* ============================================
   Maikel & Lonneke â€” Samen 60
   Elegant donker thema met champagne-goud
   ============================================ */

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

:root {
    --gold: #d9a79b;
    --gold-bright: #f0cdc2;
    --gold-deep: #b27a6b;
    --ink: #12100e;
    --ink-soft: #1c1916;
    --card-bg: rgba(255, 255, 255, 0.055);
    --card-border: rgba(217, 167, 155, 0.22);
    --text: #f3efe7;
    --text-dim: rgba(243, 239, 231, 0.62);
    --danger: #e4756b;
    --success: #7fbf8e;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --radius: 22px;
    --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    background: var(--ink);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh; /* iOS Safari: correcte hoogte met adresbalk */
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    touch-action: manipulation; /* geen dubbeltik-zoom vertraging */
}

/* Sfeervolle achtergrondgloed */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(217, 167, 155, 0.16), transparent 60%),
        radial-gradient(ellipse 60% 40% at 85% 110%, rgba(217, 167, 155, 0.08), transparent 60%),
        var(--ink);
    pointer-events: none;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    /* Safe areas voor notch / home-indicator (iPhone & Android) */
    padding: calc(20px + env(safe-area-inset-top, 0px))
             calc(20px + env(safe-area-inset-right, 0px))
             calc(12px + env(safe-area-inset-bottom, 0px))
             calc(20px + env(safe-area-inset-left, 0px));
}

/* ============ Header ============ */

header {
    text-align: center;
    padding: 18px 0 26px;
    animation: fadeDown 0.8s ease both;
}

.header-photo {
    width: clamp(140px, 40vw, 190px);
    height: clamp(140px, 40vw, 190px);
    margin: 0 auto 18px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    outline: 1px solid rgba(217, 167, 155, 0.25);
    outline-offset: 6px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
}

.header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.05);
}

.eyebrow {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8.5vw, 2.6rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--text);
    white-space: nowrap;
}

header h1 .amp {
    font-style: italic;
    font-weight: 500;
    color: var(--gold);
    padding: 0 0.25em;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px auto 8px;
    max-width: 220px;
}

.divider .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
}

.divider .line:last-child {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.divider .diamond {
    color: var(--gold);
    font-size: 0.5rem;
}

.subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--gold-bright);
    letter-spacing: 0.04em;
}

/* ============ Main ============ */

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 26px 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: fadeUp 0.6s ease both;
}

.card-intro {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 22px;
    line-height: 1.55;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============ Buttons ============ */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px; /* ruime touch-target */
    padding: 15px 24px;
    border: none;
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.btn .icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.btn .icon svg {
    width: 100%;
    height: 100%;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 6px 22px rgba(217, 167, 155, 0.28);
}

.btn-primary:active {
    box-shadow: 0 3px 12px rgba(217, 167, 155, 0.2);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--gold-bright);
}

.btn-outline:active {
    background: rgba(217, 167, 155, 0.08);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
}

.btn-ghost:active {
    background: rgba(255, 255, 255, 0.1);
}

.btn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* ============ Camera (desktop fallback) ============ */

.camera-preview {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.camera-preview video {
    flex: 1;
    width: 100%;
    object-fit: cover;
}

.camera-controls {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 34px;
    padding: 20px;
}

.btn-icon {
    width: 54px;
    height: 54px;
    min-height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 14px;
}

.btn-capture {
    width: 76px;
    height: 76px;
    min-height: 76px;
    border-radius: 50%;
    background: white;
    border: 4px solid rgba(255, 255, 255, 0.35);
    background-clip: padding-box;
    padding: 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ============ Preview ============ */

.preview-section h2 {
    font-family: var(--font-display);
    text-align: center;
    margin-bottom: 14px;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--gold-bright);
}

.preview-container {
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 24vh;
    max-height: 24dvh;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
}

.preview-container img {
    max-width: 100%;
    max-height: 24vh;
    max-height: 24dvh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 22px;
    object-fit: contain;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.preview-actions .btn-ghost {
    flex: 1;
}

.preview-actions .btn-primary {
    flex: 1.6;
}

/* Upload voortgang */
.upload-progress {
    margin-bottom: 16px;
}

.progress-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
    transition: width 0.25s ease;
}

.progress-label {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 8px;
}

/* ============ Succes ============ */

.success-message {
    text-align: center;
    padding: 38px 26px;
}

.success-check {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
}

.success-check svg {
    width: 100%;
    height: 100%;
}

.check-circle {
    stroke: var(--gold);
    stroke-width: 2;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: drawCircle 0.6s ease forwards;
}

.check-mark {
    stroke: var(--gold-bright);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: drawCheck 0.4s ease 0.45s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-message h2 {
    font-family: var(--font-display);
    color: var(--gold-bright);
    font-size: 1.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.success-message p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 26px;
}

/* ============ Foto teller ============ */

.photo-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.95rem;
    animation: fadeUp 0.6s ease 0.15s both;
}

.count-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: var(--gold);
}

.count-icon svg {
    width: 100%;
    height: 100%;
}

.photo-count strong {
    font-weight: 600;
    color: var(--gold-bright);
    font-size: 1.1rem;
}

/* ============ Footer ============ */

footer {
    text-align: center;
    padding: 22px 0 6px;
    color: rgba(243, 239, 231, 0.32);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

footer a {
    color: rgba(217, 167, 155, 0.55);
    text-decoration: none;
}

/* ============ Toast meldingen ============ */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    max-width: min(90vw, 420px);
    background: rgba(28, 25, 22, 0.95);
    border: 1px solid rgba(228, 117, 107, 0.4);
    color: var(--text);
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 0.92rem;
    text-align: center;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ Utilities & animaties ============ */

.hidden {
    display: none !important;
}

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

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

/* Loading spinner op knop */
.loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.loading .icon {
    visibility: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 2.5px solid rgba(18, 16, 14, 0.25);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Respecteer 'minder beweging' instelling */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Hover alleen op apparaten die echt kunnen hoveren (desktop) */
@media (hover: hover) {
    .btn-primary:hover {
        box-shadow: 0 8px 28px rgba(217, 167, 155, 0.4);
        transform: translateY(-1px);
    }

    .btn-outline:hover {
        background: rgba(217, 167, 155, 0.08);
        border-color: var(--gold);
    }

    .btn-ghost:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    footer a:hover {
        color: var(--gold-bright);
    }
}

/* ============ Kleine schermen ============ */

@media (max-width: 360px) {
    .card {
        padding: 20px 16px;
    }

    .btn {
        font-size: 0.95rem;
    }
}

/* ============ Landscape (telefoon gekanteld) ============ */

@media (orientation: landscape) and (max-height: 520px) {
    .container {
        max-width: 100%;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }

    header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 8px 0 14px;
    }

    .header-photo {
        width: 58px;
        height: 58px;
        margin: 0;
        outline-offset: 3px;
    }

    .eyebrow, .divider {
        display: none;
    }

    header h1 {
        font-size: 1.45rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        max-width: 560px;
        margin: 0 auto;
        width: 100%;
    }

    .card {
        padding: 16px 20px;
    }

    .card-intro {
        margin-bottom: 14px;
    }

    .button-group {
        flex-direction: row;
    }

    .preview-section {
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .preview-section h2 {
        display: none;
    }

    .preview-container {
        flex: 1;
        max-height: 40vh;
        max-height: 40dvh;
        margin-bottom: 0;
    }

    .preview-container img {
        max-height: 40vh;
        max-height: 40dvh;
    }

    .preview-actions {
        flex-direction: column;
        min-width: 150px;
    }

    .success-message {
        padding: 20px;
    }

    .success-check {
        width: 56px;
        height: 56px;
        margin-bottom: 10px;
    }

    .success-message h2 {
        font-size: 1.4rem;
    }

    .success-message p {
        margin-bottom: 14px;
    }

    footer {
        padding: 10px 0 4px;
    }
}
