/* ── Yearbook Frontend Styles ──────────────────────────────────── */

.yearbook-app {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: inherit;
    color: #1a1a1a;
}

/* ── Login ─────────────────────────────────────────────────────── */

.yearbook-login-wrap { max-width: 420px; margin: 0 auto; }
.yearbook-school-name { font-size: 1.5rem; margin-bottom: .25rem; }
.yearbook-order-name  { font-size: 1.1rem; color: #555; margin-bottom: 1.5rem; font-weight: 400; }

.yearbook-deadline {
    background: #fff8e1;
    border-left: 4px solid #f59e0b;
    padding: .6rem 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1.5rem;
    font-size: .9rem;
}

.yearbook-login-form { background: #f9f9f9; border: 1px solid #e5e7eb; border-radius: 10px; padding: 1.75rem; }

.yearbook-field { margin-bottom: 1rem; }
.yearbook-field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .92rem; }
.yearbook-field input { width: 100%; padding: .55rem .75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1rem; box-sizing: border-box; }
.yearbook-field input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.required { color: #e53e3e; }

/* ── Buttons ───────────────────────────────────────────────────── */

.yearbook-btn {
    display: inline-block;
    padding: .6rem 1.4rem;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.yearbook-btn:active { transform: scale(.98); }

.yearbook-btn-primary  { background: #2563eb; color: #fff; }
.yearbook-btn-primary:hover { background: #1d4ed8; color: #fff; }

.yearbook-btn-secondary { background: #059669; color: #fff; }
.yearbook-btn-secondary:hover { background: #047857; color: #fff; }

.yearbook-btn-outline { background: transparent; border: 1.5px solid #d1d5db; color: #555; }
.yearbook-btn-outline:hover { background: #f3f4f6; }

/* ── Error ─────────────────────────────────────────────────────── */

.yearbook-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: .6rem .9rem;
    color: #991b1b;
    font-size: .9rem;
    margin-bottom: 1rem;
}

/* ── Selection header ──────────────────────────────────────────── */

.yearbook-selection-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}
.yearbook-selection-header h2 { margin: 0; flex: 1 1 100%; font-size: 1.35rem; }

.yearbook-already-submitted {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: .9rem;
    color: #065f46;
}

.yearbook-instructions {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: .75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
    font-size: .92rem;
}

/* ── Photo grid ────────────────────────────────────────────────── */

.yearbook-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.yearbook-photo-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.yearbook-photo-card.ranked { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

.yearbook-photo-img-wrap {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: pointer;
    background: #f3f4f6;
}
.yearbook-photo-thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}
.yearbook-photo-img-wrap:hover .yearbook-photo-thumb { transform: scale(1.03); }

.yearbook-photo-rank-badge {
    position: absolute;
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.yearbook-photo-controls {
    padding: .5rem;
}

/* Ranking number buttons */
.yearbook-rank-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.yearbook-rank-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s, opacity .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.yearbook-rank-btn:hover:not(:disabled):not(.selected) {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.yearbook-rank-btn.selected {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.yearbook-rank-btn.unavailable,
.yearbook-rank-btn:disabled {
    opacity: .25;
    cursor: not-allowed;
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
}

/* ── Lightbox ──────────────────────────────────────────────────── */

.yearbook-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    cursor: zoom-out;
}
.yearbook-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
    cursor: default;
}
.yearbook-lightbox-close {
    position: absolute;
    top: 1rem; right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

/* ── Contact form ──────────────────────────────────────────────── */

.yearbook-contact-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.75rem;
    margin-top: 1rem;
}
.yearbook-contact-form h3 { margin-top: 0; }

.yearbook-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 540px) { .yearbook-form-grid { grid-template-columns: 1fr; } }

/* ── Confirmation ──────────────────────────────────────────────── */

.yearbook-confirmation {
    text-align: center;
    padding: 3rem 1rem;
}
.yearbook-confirmation .yearbook-check { font-size: 4rem; margin-bottom: 1rem; }
.yearbook-confirmation h2 { color: #065f46; }

/* ── Deadline passed ───────────────────────────────────────────── */

.yearbook-deadline-passed {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff8e1;
    border-radius: 10px;
    color: #92400e;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .yearbook-photo-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .yearbook-login-form { padding: 1.25rem; }
}
