/* ═══════════════════════════════════════════════════════════════
   Ziua Cărții — Bookster Campaign
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    color: #101820;
    background-color: #FFFAF5;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background — bunting at top, confetti on sides */
body::before {
    content: '';
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-color: #FFFAF5;
    background-image: url('../images/fundal-ziua-cartii.png');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Scroll Hint ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }

.scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #A7A8AA;
    margin: 24px auto 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s;
    opacity: 0.7;
}

.scroll-hint:hover {
    color: #F4364C;
    opacity: 1;
}

.scroll-hint-arrow {
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    animation: bounce-down 1.8s ease-in-out infinite;
}

@keyframes bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ── Top Bar ───────────────────────────────────────────────── */
.top-bar {
    padding: 12px 0;
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

body {
    padding-top: 52px;
}

.top-bar .container {
    display: flex;
    align-items: center;
}

.top-bar-logo-link {
    display: inline-block;
}

.top-bar-logo {
    height: 28px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.top-bar-logo:hover {
    opacity: 1;
}

/* ── (legacy .bg-pattern div kept for markup compat) ──────── */
.bg-pattern { display: none; }

/* ── Hero + Form ────────────────────────────────────────────── */
.hero-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 0 40px;
}

@media (max-width: 768px) {
    .hero-form { padding-top: 110px; }
}

@media (max-width: 480px) {
    .hero-form { padding-top: 90px; }
}

.hero-form .container {
    max-width: 440px;
    text-align: center;
}

.hero-title {
    font-weight: 600;
    font-size: clamp(22px, 2.4vw, 28px);
    color: #101820;
    margin-bottom: 20px;
    line-height: 1.25;
}

/* ── Form ───────────────────────────────────────────────────── */
.wish-form {
    text-align: left;
}

.form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #101820;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
    color: #A7A8AA;
    font-weight: 300;
}

.form-input:focus {
    border-color: #F4364C;
    box-shadow: 0 0 0 3px rgba(244, 54, 76, 0.08);
}

.form-input.error {
    border-color: #F4364C;
}

.form-textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.5;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    font-weight: 400;
    color: #A7A8AA;
    margin-top: 6px;
    transition: color 0.2s;
}

.char-counter.near-limit {
    color: #F4364C;
    font-weight: 600;
}

/* ── Book Search ────────────────────────────────────────────── */
.search-input-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-field {
    padding-left: 42px;
}

.search-hint {
    font-size: 13px;
    color: #75787B;
    margin-top: 8px;
    font-weight: 400;
}

.search-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 28px);
    z-index: 50;
    background: #fff;
    border: 2px solid #eee;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.search-dropdown.active {
    display: block;
}

.search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result:hover {
    background: #FFF5F6;
}

.search-result-cover {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-weight: 600;
    font-size: 14px;
    color: #101820;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-author {
    font-weight: 300;
    font-size: 13px;
    color: #75787B;
}

/* ── Book Preview Card ──────────────────────────────────────── */
.book-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 2px solid #E1E1FF;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    position: relative;
}

.book-preview-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    color: #A7A8AA;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.book-preview-close:hover {
    color: #F4364C;
}

.book-preview-cover {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.book-preview-title {
    font-weight: 600;
    font-size: 15px;
    color: #101820;
}

.book-preview-author {
    font-weight: 300;
    font-size: 13px;
    color: #75787B;
    margin-top: 2px;
}

/* ── Submit Button ──────────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 16px 32px;
    background: #F4364C;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.btn-submit:hover {
    background: #d42d40;
}

.btn-submit:active {
    transform: scale(0.98);
}

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

@media (min-width: 640px) {
    .btn-submit {
        width: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        min-width: 220px;
    }
}

/* ── Success Section ────────────────────────────────────────── */
.success-section {
    text-align: center;
    padding: 40px 0 20px;
}

.success-title {
    font-weight: 600;
    font-size: clamp(20px, 3vw, 28px);
    color: #101820;
    margin-bottom: 16px;
}

.btn-download {
    display: inline-block;
    padding: 14px 28px;
    background: transparent;
    color: #F4364C;
    border: 2px solid #F4364C;
    border-radius: 24px;
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #F4364C;
    color: #fff;
}

/* ── Wishes Wall ────────────────────────────────────────────── */
.wishes-wall {
    padding: 60px 0 80px;
}

.wall-header {
    text-align: center;
    margin-bottom: 40px;
}

.wall-title {
    font-weight: 600;
    font-size: clamp(22px, 3.5vw, 32px);
    color: #101820;
}

.wall-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.wall-decoration span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.wall-decoration span:nth-child(1) { background: #FFC7CF; }
.wall-decoration span:nth-child(2) { background: #F4364C; }
.wall-decoration span:nth-child(3) { background: #FFC72C; }

.wall-empty {
    text-align: center;
    padding: 60px 20px;
    color: #A7A8AA;
    font-size: 16px;
}

/* ── Wishes Grid ───────────────────────────────────────────── */
.masonry {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .masonry { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .masonry { grid-template-columns: repeat(3, 1fr); }
}

/* ── Wish Card ──────────────────────────────────────────────── */
.wish-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
    border-left: 2px solid transparent;
}

.wish-card:nth-child(3n+1) { border-left-color: #FFC7CF; }
.wish-card:nth-child(3n+2) { border-left-color: #E1E1FF; }
.wish-card:nth-child(3n+3) { border-left-color: #FFC72C; }

.wish-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.wish-card.own-wish {
    background: rgba(255, 199, 44, 0.08);
    border-left-color: #FFC72C;
}

.wish-card.pinned-wish {
    position: relative;
}

.pin-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    color: #FFC72C;
}

/* ── Cover with Party Hat ───────────────────────────────────── */
.wish-card-cover-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.cover-inner {
    position: relative;
    display: inline-block;
}

.wish-card-cover {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.placeholder-cover {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.party-hat {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    width: 56px;
    height: auto;
    transform-origin: bottom center;
    transition: transform 0.5s ease-in-out;
    z-index: 2;
    pointer-events: none;
}

.wish-card:hover .party-hat {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0% { transform: translateX(-50%) rotate(-5deg); }
    20% { transform: translateX(-50%) rotate(-10deg); }
    40% { transform: translateX(-50%) rotate(0deg); }
    60% { transform: translateX(-50%) rotate(-9deg); }
    80% { transform: translateX(-50%) rotate(-2deg); }
    100% { transform: translateX(-50%) rotate(-5deg); }
}

/* ── Card Content ───────────────────────────────────────────── */
.cover-link {
    display: block;
}

.wish-card-book-title {
    font-weight: 600;
    font-size: 16px;
    color: #101820;
    margin-bottom: 2px;
    text-align: center;
}

.wish-card-book-title a {
    color: #F4364C;
    text-decoration: none;
}

.wish-card-book-title a:hover {
    text-decoration: underline;
}

.wish-card-book-author {
    font-weight: 300;
    font-size: 13px;
    color: #75787B;
    margin-bottom: 8px;
    text-align: center;
}

.wish-card-age-badge {
    display: inline-block;
    background: #FFC72C;
    color: #101820;
    font-weight: 400;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.wish-card-message {
    font-weight: 300;
    font-size: 15px;
    color: #101820;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-line;
}

.wish-card-sender {
    font-weight: 400;
    font-size: 13px;
    color: #A7A8AA;
    font-style: italic;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid #f0ece8;
}

.site-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-logo-link {
    display: inline-block;
}

.footer-logo {
    height: 36px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: #75787B;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #F4364C;
}

/* ── Privacy / consent texts ──────────────────────────────── */
.consent-notice {
    font-size: 12px;
    color: #75787B;
    text-align: center;
    margin: 12px auto 0;
    line-height: 1.5;
    max-width: 440px;
}

.form-hint-privacy {
    font-size: 12px;
    color: #A7A8AA;
    margin: 6px 0 0;
    line-height: 1.4;
}

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ── Utility ────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
