@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --ivory: #faf6f0;
    --cream: #f5ebe0;
    --blush: #f0d5cf;
    --soft-rose: #e8a0a0;
    --rose: #c9536c;
    --deep-rose: #a63d5a;
    --burgundy: #6b1d3a;
    --charcoal: #2c2c2c;
    --soft-charcoal: #4a4a4a;
    --muted-charcoal: #6b6b6b;
    --gold: #c9a961;
    --success: #5a8a5f;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 2px 20px rgba(107,29,58,0.06);
    --shadow-medium: 0 4px 30px rgba(107,29,58,0.1);
    --shadow-strong: 0 8px 40px rgba(107,29,58,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    color: var(--charcoal);
    background: var(--ivory);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 8vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 5.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 4vw, 1.6rem); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    text-decoration: none;
    white-space: nowrap;
    min-height: 52px;
}
.btn-primary {
    background: var(--burgundy);
    color: white;
    box-shadow: 0 4px 20px rgba(107,29,58,0.25);
}
.btn-primary:hover {
    background: var(--deep-rose);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(107,29,58,0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: transparent;
    color: var(--burgundy);
    border: 1.5px solid var(--burgundy);
}
.btn-secondary:hover {
    background: var(--burgundy);
    color: white;
}
.btn-whatsapp {
    background: #25D366;
    color: white;
    width: 100%;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1.5rem;
    background: rgba(250,246,240,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.nav-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--burgundy);
    text-decoration: none;
}

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1.5rem 3rem;
    text-align: center;
    background: linear-gradient(180deg, var(--ivory) 0%, var(--cream) 100%);
}
.hero-content { max-width: 500px; z-index: 2; }
.hero h1 { margin-bottom: 1rem; color: var(--charcoal); }
.hero-subtitle {
    font-size: 1.05rem;
    color: var(--soft-charcoal);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.rose-canvas-wrapper {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1;
    margin: 1.5rem auto;
    position: relative;
    cursor: grab;
}
.rose-canvas-wrapper:active { cursor: grabbing; }
.rose-canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.rotation-hint {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44,44,44,0.85);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    white-space: nowrap;
}
.rotation-hint.visible { opacity: 1; }

.section { padding: 4rem 1.5rem; }
.section-alt { background: var(--cream); }
.section-title { text-align: center; margin-bottom: 3rem; }

.steps {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 500px;
    margin: 0 auto;
}
.step { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--burgundy);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
}
.step-content h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.step-content p { color: var(--soft-charcoal); font-size: 0.95rem; }

.voice-feature { text-align: center; max-width: 500px; margin: 0 auto; }
.voice-feature h2 { margin-bottom: 1rem; }
.voice-feature > p { color: var(--soft-charcoal); margin-bottom: 2rem; }
.mic-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose), var(--burgundy));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-medium);
}

.final-cta {
    text-align: center;
    padding: 5rem 1.5rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--ivory) 100%);
}
.final-cta h2 { margin-bottom: 1rem; }
.final-cta p { color: var(--soft-charcoal); margin-bottom: 2rem; font-size: 1.05rem; }

.footer {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--muted-charcoal);
    font-size: 0.85rem;
    border-top: 1px solid rgba(107,29,58,0.08);
}

/* Creation Page */
.create-page {
    min-height: 100vh;
    padding: 4.5rem 1.5rem 3rem;
    background: var(--ivory);
}
.creation-header { text-align: center; margin-bottom: 2.5rem; }
.creation-header h1 { font-size: 1.7rem; margin-bottom: 0.5rem; }
.creation-header p { color: var(--soft-charcoal); }

.form-step { margin-bottom: 2rem; }
.form-step-label {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    color: var(--charcoal);
}
.form-input, .form-textarea {
    width: 100%;
    padding: 0.9rem 1.1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1.5px solid rgba(107,29,58,0.12);
    border-radius: 12px;
    background: white;
    color: var(--charcoal);
    transition: all 0.3s var(--ease-smooth);
}
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(201,83,108,0.1);
}
.form-textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.char-count {
    text-align: right;
    font-size: 0.82rem;
    color: var(--muted-charcoal);
    margin-top: 0.4rem;
}

/* Voice Recording UI */
.voice-recorder {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1.5px solid rgba(107,29,58,0.1);
    text-align: center;
}
.record-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--rose), var(--burgundy));
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s;
}
.record-btn:hover { transform: scale(1.05); }
.record-btn.recording {
    animation: pulse-record 1.5s infinite;
    background: #dc3545;
}
.stop-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
}

@keyframes pulse-record {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.5); }
    50% { box-shadow: 0 0 0 15px rgba(220,53,69,0); }
}

.recording-status { margin-top: 1rem; font-size: 0.9rem; color: var(--muted-charcoal); }
.recording-active { color: #dc3545; font-weight: 500; }
.recording-done { color: var(--success); font-weight: 500; }
.recording-timer {
    font-variant-numeric: tabular-nums;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.audio-controls {
    display: none;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}
.audio-controls.active { display: flex; }
.audio-controls button {
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(107,29,58,0.2);
    background: white;
    color: var(--charcoal);
    font-size: 0.85rem;
    cursor: pointer;
}
.audio-controls button:hover { background: var(--cream); }
.audio-container { margin-top: 1rem; }
.audio-container audio { width: 100%; }

/* Preview */
.preview-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1.5px solid rgba(107,29,58,0.1);
}
.preview-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-charcoal);
    margin-bottom: 1rem;
    text-align: center;
}
.preview-rose-wrapper {
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
}
.preview-rose-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}
.preview-text { text-align: center; }
.preview-text .recipient-preview {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--burgundy);
    margin-bottom: 0.5rem;
}
.preview-text .message-preview {
    color: var(--soft-charcoal);
    font-size: 0.95rem;
    font-style: italic;
    min-height: 1.5em;
}
.preview-text .sender-preview {
    font-size: 0.85rem;
    color: var(--muted-charcoal);
    margin-top: 0.75rem;
}

/* Success Panel */
.success-panel { display: none; text-align: center; padding: 2rem 0; }
.success-panel h2 { margin-bottom: 1rem; }
.success-panel > p { color: var(--soft-charcoal); margin-bottom: 2rem; }
.summary-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    border: 1px solid rgba(107,29,58,0.1);
}
.summary-item {
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(107,29,58,0.06);
}
.summary-item:last-child { border-bottom: none; }
.summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-charcoal);
    margin-bottom: 0.2rem;
}
.summary-value { font-size: 1rem; color: var(--charcoal); }
.button-group { display: flex; flex-direction: column; gap: 0.75rem; }

/* Recipient Experience */
.recipient-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(180deg, var(--ivory) 0%, var(--cream) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
}
.initial-state { text-align: center; z-index: 2; transition: opacity 0.5s; }
.initial-state h1 { margin-bottom: 1.5rem; }

.rose-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    opacity: 0;
    transition: opacity 0.8s;
}
.rose-view .rose-canvas-wrapper {
    width: 100%;
    max-width: 340px;
}

.sender-info { text-align: center; margin-top: 1.5rem; opacity: 0; }
.sender-info .from-text {
    font-size: 0.85rem;
    color: var(--muted-charcoal);
    margin-bottom: 0.2rem;
}
.sender-info .sender-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--burgundy);
}

.message-content {
    text-align: center;
    margin-top: 1.5rem;
    max-width: 400px;
    padding: 0 1rem;
    opacity: 0;
}
.message-content p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--charcoal);
    line-height: 1.7;
}

.voice-section {
    margin-top: 1.5rem;
    opacity: 0;
    width: 100%;
    max-width: 300px;
}
.voice-player-wrapper {
    padding: 0.8rem 1.5rem;
    background: white;
    border: 1.5px solid rgba(107,29,58,0.15);
    border-radius: 100px;
}
.voice-player-wrapper audio { width: 100%; }

.error-state { display: none; text-align: center; padding: 3rem 1rem; }
.error-state h2 { margin-bottom: 1rem; color: var(--burgundy); }

.back-btn {
    position: fixed;
    top: 1.2rem;
    left: 1.2rem;
    z-index: 100;
    background: white;
    border: 1px solid rgba(107,29,58,0.1);
    border-radius: 100px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--charcoal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s;
}
.back-btn:hover { box-shadow: var(--shadow-medium); }

/* Responsive */
@media (min-width: 768px) {
    .hero { padding: 6rem 2rem 4rem; }
    .rose-canvas-wrapper { max-width: 440px; }
    .section { padding: 5rem 2rem; }
    .steps { max-width: 600px; }
    .step { gap: 2rem; }
}
@media (max-height: 700px) {
    .hero { min-height: auto; padding-top: 5rem; padding-bottom: 2rem; }
    .rose-canvas-wrapper { max-width: 280px; }
}

/* ---- v2: accent rengi + zelif addim kartlari ---- */
.rose-accent {
    color: var(--rose);
}

.steps {
    gap: 1.25rem;
    max-width: 520px;
}

.step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.9rem;
    background: #ffffff;
    border: 1px solid rgba(107,29,58,0.08);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-soft);
}

.step-number {
    width: 44px;
    height: 44px;
    background: transparent;
    color: var(--rose);
    border: 1px solid rgba(201,83,108,0.5);
    font-size: 1.15rem;
    font-weight: 500;
    font-style: italic;
}

.step-content h3 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.step-content p {
    font-size: 0.95rem;
}

/* ---- v5: gradient CTA + emotional centering (mobile + desktop) ---- */
.hero .btn-primary,
.final-cta .btn-primary,
.create-page .btn-primary {
    background: linear-gradient(90deg, #dc143c 0%, #8b0000 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 26px rgba(220, 20, 60, 0.30);
}

.hero .btn-primary:hover,
.final-cta .btn-primary:hover,
.create-page .btn-primary:hover {
    background: linear-gradient(90deg, #dc143c 0%, #8b0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(139, 0, 0, 0.40);
}

.emotional-section {
    text-align: center;
}

.emotional-section .container,
.emotional-block {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.emotional-section .section-title {
    text-align: center;
}

.emotional-copy {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    color: var(--soft-charcoal);
    font-size: 1.05rem;
    line-height: 1.85;
}

@media (min-width: 768px) {
    .emotional-section,
    .emotional-section .container,
    .emotional-block,
    .emotional-section .section-title,
    .emotional-copy {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---- v7: rose isiq ocagi (premium paketden yalniz saxlanilan hisse) ---- */
.rose-canvas-wrapper::before {
    content: "";
    position: absolute;
    inset: 6% 2%;
    background:
        radial-gradient(closest-side, rgba(232,160,160,.38), rgba(232,160,160,0) 72%),
        radial-gradient(60% 22% at 50% 88%, rgba(139,0,0,.14), rgba(139,0,0,0) 70%);
    z-index: 0;
}
.rose-canvas-wrapper canvas {
    position: relative;
    z-index: 1;
}

/* ---- v8: ucan lecekler qati ---- */
body > *:not(.petal-layer) {
    position: relative;
    z-index: 1;
}
.petal-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.petal {
    position: absolute;
    top: -12%;
    background: radial-gradient(closest-side, rgba(201,83,108,.5), rgba(201,83,108,0) 78%);
    border-radius: 62% 38% 60% 40% / 70% 30% 70% 30%;
    filter: blur(7px);
    opacity: .12;
    will-change: transform;
}

/* ---- v9: petal layer foreground (bokeh effekti) ---- */
.petal-layer {
    z-index: 60;
}

/* ---- v10: hero eyebrow + struktur nefesi ---- */
.hero .eyebrow {
    font-size: .68rem;
    letter-spacing: .35em;
    text-transform: uppercase;
    color: var(--rose);
    font-weight: 600;
    margin-bottom: .9rem;
}
.hero-content .btn {
    margin-top: .5rem;
}
.hero .rose-canvas-wrapper {
    margin-top: 2rem;
}

/* ---- v11: hero bloku 10% yuxari ---- */
.hero-content,
.hero .rose-canvas-wrapper {
    transform: translateY(-8vh);
}

/* ---- v12: hero-alti olu bosluqlarin kesilmesi ---- */
.hero {
    min-height: auto;
    padding-bottom: 0;
    margin-bottom: -5vh;
}
.hero + .section {
    padding-top: calc(2rem + 5vh);
}

/* ---- v13: back-btn fixed berpası (v8 qaydasi onu qirmisdi) ---- */
.back-btn {
    position: fixed !important;
    width: auto !important;
}

/* ---- v14: back-btn z-index berpası ---- */
.back-btn {
    z-index: 100 !important;
}

/* ---- v15: loading spinner ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
