
/* =========================================================
   OPENWHEN — DESIGN SYSTEM
   Royal & Premium | Midnight Emerald
   ========================================================= */


/* ---------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------- */

:root {
    --background: #F1EFEB;
    --surface: #FFFFFF;
    --surface-soft: #EAE8E2;
    --surface-sage: #E4EAE5;

    --primary: #173C32;
    --primary-dark: #102D26;
    --primary-light: #D9E4DD;

    --text: #252923;
    --text-secondary: #73776F;
    --text-light: #989A91;

    --border: #E3E1DA;
    --border-strong: #D2D1C8;

    --accent: #B3945F;
    --success: #477A58;
    --danger: #B85C50;
    --warning: #A67C43;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;

    --shadow-sm: 0 2px 8px rgba(23, 40, 33, 0.045);
    --shadow-md: 0 8px 28px rgba(23, 40, 33, 0.075);
    --shadow-lg: 0 16px 45px rgba(23, 40, 33, 0.11);

    --transition: 0.25s ease;

    --container-width: 1120px;
}


/* ---------------------------------------------------------
   2. RESET
   --------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    background: var(--background);
    color: var(--text);

    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}


/* ---------------------------------------------------------
   3. TYPOGRAPHY
   --------------------------------------------------------- */

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.25;
    color: var(--text);
}

h1 {
    font-size: clamp(2.3rem, 5vw, 3.7rem);
    letter-spacing: -1.5px;
}

h2 {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    letter-spacing: -0.7px;
}

h3 {
    font-size: 1.4rem;
}

p {
    color: var(--text-secondary);
}

small {
    font-size: 0.82rem;
}


/* ---------------------------------------------------------
   4. NAVIGATION
   --------------------------------------------------------- */

.site-header {
    width: 100%;
    background: rgba(241, 239, 235, 0.95);
    border-bottom: 1px solid var(--border);

    position: sticky;
    top: 0;
    z-index: 100;

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.navbar {
    max-width: var(--container-width);
    min-height: 76px;

    margin: 0 auto;
    padding: 0 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--primary);
    flex-shrink: 0;
}

.logo-mark {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary);
    color: white;

    border-radius: 11px;
    transform: rotate(-5deg);
}

.logo-mark-inner {
    font-family: var(--font-heading);
    font-size: 23px;
    font-weight: 600;
    line-height: 1;
}

.logo-text,
.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.6px;
}

.logo-period {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;

    transition: color var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-create,
.nav-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: var(--primary);
    color: white;

    padding: 10px 19px;
    border-radius: 10px;

    transition:
        background var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.nav-create:hover,
.nav-register:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-create-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.nav-arrow {
    font-size: 1.1rem;
}

.nav-logout {
    color: var(--danger);
}

.nav-logout:hover {
    color: #923F36;
}


/* ---------------------------------------------------------
   5. MAIN CONTENT
   --------------------------------------------------------- */

.main-content {
    width: 100%;
    flex: 1;
}

.container {
    width: min(100% - 48px, var(--container-width));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.page-header {
    margin-bottom: 36px;
}

.page-header h1 {
    margin-bottom: 12px;
}

.page-header p {
    max-width: 620px;
}


/* ---------------------------------------------------------
   6. BUTTONS
   --------------------------------------------------------- */

button,
.button,
.primary-button,
.secondary-button,
.danger-button {
    font-family: var(--font-body);
}

.button,
.primary-button,
.secondary-button,
.danger-button {
    min-height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 11px 22px;
    border-radius: 10px;

    font-size: 0.92rem;
    font-weight: 600;

    border: 1px solid transparent;

    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.primary-button,
.button-primary {
    background: var(--primary);
    color: #FFFFFF;
}

.primary-button:hover,
.button-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-button,
.button-secondary {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--border-strong);
}

.secondary-button:hover,
.button-secondary:hover {
    background: var(--surface-sage);
    border-color: var(--primary-light);
}

.danger-button {
    background: #FBF0EE;
    color: var(--danger);
    border-color: #F0DAD5;
}

.danger-button:hover {
    background: #F6E4E0;
}

button:disabled,
.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* ---------------------------------------------------------
   7. CARDS
   --------------------------------------------------------- */

.card,
.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    padding: 28px;

    box-shadow: var(--shadow-sm);

    transition:
        box-shadow var(--transition),
        transform var(--transition);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.92rem;
}


/* ---------------------------------------------------------
   8. FORMS
   --------------------------------------------------------- */

.form-group {
    margin-bottom: 22px;
}

.form-group label,
label {
    display: block;
    margin-bottom: 8px;

    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;

    padding: 13px 15px;

    background: #FDFDFC;
    color: var(--text);

    border: 1px solid var(--border-strong);
    border-radius: 10px;

    font-size: 0.93rem;

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: #AAA99F;
}

input:focus,
textarea:focus,
select:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 60, 50, 0.10);
}

textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.8;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--primary);
}

input[type="file"] {
    padding: 10px;
}

input[type="submit"] {
    cursor: pointer;
}


/* ---------------------------------------------------------
   9. FLASH MESSAGES
   --------------------------------------------------------- */

.flash-container {
    width: min(100% - 48px, 760px);
    margin: 18px auto 0;
}

.flash {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 18px;
    margin-bottom: 10px;

    background: #E9F0EB;
    border: 1px solid #D5E2D9;
    border-radius: 11px;

    color: var(--primary);
    font-size: 0.9rem;
}

.flash-indicator {
    width: 8px;
    height: 8px;
    flex-shrink: 0;

    border-radius: 50%;
    background: var(--success);
}


/* ---------------------------------------------------------
   10. BADGES AND STATUS
   --------------------------------------------------------- */

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 11px;

    border-radius: 50px;

    font-size: 0.77rem;
    font-weight: 600;
}

.badge-success,
.status-unlocked {
    background: #E8F1E7;
    color: #477A58;
}

.badge-warning,
.status-locked {
    background: #F3EEE3;
    color: #94713D;
}

.badge-danger {
    background: #F8EAE7;
    color: var(--danger);
}


/* ---------------------------------------------------------
   11. DIVIDERS AND UTILITIES
   --------------------------------------------------------- */

.divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.muted {
    color: var(--text-secondary);
}

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

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }


/* ---------------------------------------------------------
   12. EMPTY STATES
   --------------------------------------------------------- */

.empty-state {
    padding: 65px 25px;
    text-align: center;

    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.empty-state h2,
.empty-state h3 {
    margin-bottom: 10px;
}

.empty-state p {
    max-width: 420px;
    margin: 0 auto 22px;
}


/* ---------------------------------------------------------
   13. FOOTER
   --------------------------------------------------------- */

.site-footer {
    width: 100%;
    margin-top: auto;

    border-top: 1px solid var(--border);
    background: #E9E7E1;
}

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;

    padding: 35px 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand {
    color: var(--primary);
    font-size: 1.3rem;
}

.footer-message {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1rem;
    color: var(--text-secondary);
}

.footer-copyright {
    font-size: 0.78rem;
    color: var(--text-light);
}


/* ---------------------------------------------------------
   14. ACCESSIBILITY
   --------------------------------------------------------- */

:focus-visible {
    outline: 3px solid rgba(179, 148, 95, 0.55);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ---------------------------------------------------------
   15. RESPONSIVE DESIGN
   --------------------------------------------------------- */

@media (max-width: 768px) {

    .navbar {
        min-height: 68px;
        padding: 0 20px;
        gap: 12px;
    }

    .logo-text {
        font-size: 1.35rem;
    }

    .logo-mark {
        width: 31px;
        height: 31px;
    }

    .nav-links {
        gap: 14px;
    }

    .nav-link {
        font-size: 0.82rem;
    }

    .nav-create,
    .nav-register {
        padding: 9px 13px;
    }

    .container {
        width: min(100% - 36px, var(--container-width));
        padding: 36px 0 55px;
    }

    .page-header {
        margin-bottom: 27px;
    }

    .card,
    .content-card {
        padding: 23px;
    }

    .footer-inner {
        padding: 28px 20px;
    }

}

@media (max-width: 520px) {

    .navbar {
        padding: 0 15px;
    }

    .logo {
        gap: 7px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .logo-mark {
        width: 28px;
        height: 28px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-link {
        font-size: 0.77rem;
    }

    .nav-create,
    .nav-register {
        padding: 8px 10px;
        gap: 4px;
    }

    .nav-logout {
        font-size: 0.73rem;
    }

    .container {
        width: calc(100% - 30px);
        padding: 30px 0 45px;
    }

    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .card,
    .content-card {
        padding: 19px;
        border-radius: 15px;
    }

    .button,
    .primary-button,
    .secondary-button,
    .danger-button {
        padding: 10px 16px;
        font-size: 0.86rem;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .flash-container {
        width: calc(100% - 30px);
    }

}


/* =========================================================
   OPENWHEN — HOMEPAGE
   ========================================================= */


/* HERO */

.home-hero {
    width: min(100% - 48px, 1120px);
    min-height: 570px;
    margin: 0 auto;

    padding: 85px 0 75px;

    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 55px;
}

.hero-content {
    max-width: 560px;
}

.hero-content h1 {
    margin-top: 23px;
    margin-bottom: 23px;

    font-size: clamp(2.8rem, 5vw, 4.3rem);
    line-height: 1.15;
    letter-spacing: -1.8px;
}

.hero-content h1 span {
    display: block;
    color: var(--primary);
    font-style: italic;
}

.hero-description {
    max-width: 465px;

    font-size: 1.04rem;
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 23px;

    margin-top: 32px;
}

.hero-actions .primary-button {
    min-height: 52px;
    padding: 13px 23px;
}

.hero-secondary-link {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.hero-secondary-link span {
    color: var(--primary);
    font-weight: 700;
    margin-left: 4px;
}

.hero-secondary-link:hover span {
    text-decoration: underline;
}

.hero-note {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-top: 38px;

    color: var(--text-light);
    font-size: 0.82rem;
}

.hero-note-icon {
    color: var(--accent);
    font-size: 1.1rem;
}


/* HERO LETTER */

.hero-visual {
    min-height: 440px;

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-decoration {
    position: absolute;

    width: 310px;
    height: 385px;

    border-radius: 5px;
    background: #DFE3DC;
}

.letter-decoration-back {
    transform: rotate(8deg);
    opacity: 0.75;
}

.letter-decoration-middle {
    transform: rotate(4deg);
    background: #E9E8E1;
}

.hero-letter {
    position: relative;
    z-index: 2;

    width: min(100%, 335px);
    min-height: 390px;

    padding: 32px 29px;

    background: #FFFFFF;
    border: 1px solid #E2DED3;
    border-radius: 4px;

    box-shadow: 0 18px 55px rgba(23, 40, 33, 0.15);

    transform: rotate(-2deg);
}

.letter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.letter-small-label {
    font-size: 0.61rem;
    letter-spacing: 1.5px;
    color: var(--text-light);
    font-weight: 700;
}

.letter-symbol {
    color: var(--accent);
    font-size: 1.3rem;
}

.letter-divider {
    width: 100%;
    height: 1px;

    background: var(--border);
    margin: 20px 0 28px;
}

.letter-greeting {
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 1.65rem;
    margin-bottom: 20px;
}

.letter-message {
    font-family: var(--font-heading);
    font-size: 1.02rem;
    line-height: 1.9;

    color: #68695F;
    margin-bottom: 15px;
}

.letter-bottom {
    display: flex;
    flex-direction: column;
    margin-top: 26px;

    color: var(--text-light);
    font-size: 0.8rem;
}

.letter-signature {
    font-family: var(--font-heading);
    color: var(--primary);
    font-style: italic;
    font-size: 1.2rem;
}

.letter-stamp {
    position: absolute;
    right: 24px;
    bottom: 22px;

    width: 53px;
    height: 53px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    border: 1px solid #C9B58F;
    border-radius: 50%;

    color: var(--accent);
    font-size: 0.56rem;
    line-height: 1.3;
    letter-spacing: 1px;

    transform: rotate(12deg);
}

.hero-floating-note {
    position: absolute;
    z-index: 3;

    right: -10px;
    bottom: 22px;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 12px 17px;

    background: white;
    border: 1px solid var(--border);
    border-radius: 30px;

    box-shadow: var(--shadow-md);

    font-size: 0.76rem;
    color: var(--text-secondary);
}

.floating-note-icon {
    color: var(--accent);
    font-size: 1.1rem;
}


/* INTRODUCTION */

.home-introduction {
    padding: 65px 24px 48px;
    text-align: center;
}

.section-heading {
    max-width: 660px;
    margin: 0 auto;
}

.section-heading h2 {
    margin: 18px 0;
    font-size: clamp(2rem, 4vw, 2.9rem);
}

.section-heading h2 span {
    display: block;
    color: var(--primary);
    font-style: italic;
}

.section-heading p {
    max-width: 530px;
    margin: 0 auto;
    line-height: 1.9;
}


/* FEATURES */

.home-features {
    width: min(100% - 48px, 1120px);
    margin: 0 auto;

    padding: 28px 0 90px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.feature-card {
    position: relative;

    padding: 31px 27px;

    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-number {
    position: absolute;
    top: 22px;
    right: 24px;

    color: #D3D0C7;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.feature-icon {
    width: 49px;
    height: 49px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 24px;

    background: var(--surface-sage);
    color: var(--primary);

    border-radius: 14px;

    font-size: 1.4rem;
}

.feature-card h3 {
    margin-bottom: 12px;
    font-size: 1.45rem;
}

.feature-card p {
    font-size: 0.9rem;
    line-height: 1.85;
}


/* CLOSING SECTION */

.home-closing {
    position: relative;
    overflow: hidden;

    width: min(100% - 48px, 1120px);
    margin: 0 auto 85px;

    padding: 75px 25px;

    text-align: center;

    background: #E3EAE4;
    border: 1px solid #D5E0D7;
    border-radius: 24px;
}

.closing-decoration {
    display: block;
    margin-bottom: 17px;

    color: var(--accent);
    font-size: 1.8rem;
}

.home-closing h2 {
    max-width: 600px;
    margin: 17px auto;

    font-size: clamp(2rem, 4vw, 2.8rem);
}

.home-closing p {
    margin-bottom: 26px;
}

.home-closing .primary-button {
    min-height: 49px;
}


/* HOMEPAGE RESPONSIVENESS */

@media (max-width: 850px) {

    .home-hero {
        grid-template-columns: 1fr;
        gap: 25px;

        padding: 65px 0 45px;
    }

    .hero-content {
        max-width: 650px;
        margin: 0 auto;
        text-align: center;
    }

    .hero-description {
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-note {
        justify-content: center;
    }

    .hero-visual {
        min-height: 430px;
    }

    .hero-floating-note {
        right: 5%;
    }

    .home-features {
        grid-template-columns: 1fr;
        max-width: 580px;
    }

}

@media (max-width: 520px) {

    .home-hero {
        width: calc(100% - 34px);
        padding-top: 48px;
    }

    .hero-content h1 {
        font-size: 2.65rem;
    }

    .hero-description {
        font-size: 0.94rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 16px;
    }

    .hero-visual {
        min-height: 405px;
    }

    .hero-letter {
        width: 290px;
        min-height: 365px;
        padding: 27px 23px;
    }

    .letter-decoration {
        width: 270px;
        height: 350px;
    }

    .hero-floating-note {
        right: 0;
        bottom: 5px;
        font-size: 0.68rem;
    }

    .home-introduction {
        padding: 45px 22px 35px;
    }

    .home-features {
        width: calc(100% - 34px);
        padding-bottom: 55px;
    }

    .home-closing {
        width: calc(100% - 34px);
        margin-bottom: 55px;
        padding: 55px 22px;
    }

}


/* =========================================================
   OPENWHEN — DASHBOARD REDESIGN
   ========================================================= */


/* MAIN DASHBOARD */

.dashboard {
    width: min(100% - 48px, 1120px);
    margin: 0 auto;
    padding: 58px 0 85px;
}


/* DASHBOARD HEADER */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    margin-bottom: 38px;
}

.dashboard-welcome {
    max-width: 650px;
}

.dashboard-welcome .eyebrow {
    margin-bottom: 13px;
}

.dashboard-welcome h1 {
    font-size: clamp(2.3rem, 4vw, 3.2rem);
    margin-bottom: 12px;
}

.dashboard-intro {
    font-size: 1rem;
}

.dashboard-actions {
    flex-shrink: 0;
}

.dashboard-actions .primary-button {
    min-height: 49px;
}

.button-plus {
    font-size: 1.25rem;
    line-height: 1;
}


/* STATISTICS */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;

    margin-bottom: 62px;
}

.stat-card {
    min-height: 155px;

    padding: 23px 25px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 13px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 500;
}

.stat-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface-sage);
    color: var(--primary);

    border-radius: 10px;
    font-size: 1.1rem;
}

.stat-card strong {
    display: block;

    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 500;
    line-height: 1.2;

    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat-description {
    display: block;
    margin-top: 7px;

    color: var(--text-light);
    font-size: 0.78rem;
}

.stat-locked .stat-icon {
    background: #F1EDE3;
    color: #94713D;
}

.stat-unlocked .stat-icon {
    background: #E8F1E7;
    color: var(--success);
}


/* MESSAGES SECTION HEADER */

.dashboard-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 25px;
    padding-bottom: 21px;

    border-bottom: 1px solid var(--border);
}

.dashboard-section-header .eyebrow {
    margin-bottom: 9px;
}

.dashboard-section-header h2 {
    font-size: 2rem;
    margin-bottom: 7px;
}

.messages-subtitle {
    font-size: 0.87rem;
}

.message-total {
    flex-shrink: 0;

    padding: 7px 13px;

    background: var(--surface-soft);
    border-radius: 30px;

    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}


/* MESSAGE GRID */

.message-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}


/* MESSAGE CARDS */

.message-card {
    min-width: 0;
    min-height: 265px;

    display: flex;
    flex-direction: column;

    padding: 24px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.message-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #C9D8CE;
}

.message-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 25px;
}

.message-symbol {
    width: 39px;
    height: 39px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface-sage);
    color: var(--primary);

    border-radius: 12px;
    font-size: 1.3rem;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 6px 10px;

    border-radius: 30px;

    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status.unlocked {
    background: #E8F1E7;
    color: #477A58;
}

.status.locked {
    background: #F1EDE3;
    color: #94713D;
}

.message-origin {
    display: block;

    margin-bottom: 9px;

    color: var(--text-light);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.message-card h3 {
    font-size: 1.45rem;
    line-height: 1.35;

    margin-bottom: 11px;

    overflow-wrap: anywhere;
}

.message-card .card-description {
    font-size: 0.85rem;
    line-height: 1.75;
    margin-bottom: 17px;
}

.card-date {
    display: block;

    margin-bottom: 9px;

    color: var(--text-secondary);
    font-size: 0.76rem;
}

.message-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: auto;
    padding-top: 16px;

    border-top: 1px solid var(--border);
}

.card-open-link {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;

    transition: color var(--transition);
}

.card-arrow {
    color: var(--accent);
    font-size: 1.1rem;

    transition: transform var(--transition);
}

.message-card:hover .card-arrow {
    transform: translateX(4px);
}


/* EMPTY STATE */

.dashboard-empty {
    grid-column: 1 / -1;

    padding: 75px 25px;

    border: 1px dashed var(--border-strong);
    background: #FAFAF8;
}

.empty-illustration {
    width: 75px;
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 24px;

    background: var(--surface-sage);
    color: var(--primary);

    border-radius: 23px;

    font-size: 2rem;
}

.dashboard-empty .eyebrow {
    margin-bottom: 12px;
}

.dashboard-empty h2 {
    font-size: 2rem;
    margin-bottom: 13px;
}

.dashboard-empty p:not(.eyebrow) {
    max-width: 440px;
    margin: 0 auto 25px;

    line-height: 1.85;
}

.dashboard-empty .primary-button {
    display: inline-flex;
}


/* RESPONSIVE DASHBOARD */

@media (max-width: 900px) {

    .message-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stats {
        gap: 14px;
    }

    .stat-card {
        padding: 20px;
    }

}

@media (max-width: 650px) {

    .dashboard {
        width: calc(100% - 36px);
        padding: 38px 0 60px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 22px;

        margin-bottom: 30px;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-actions .primary-button {
        width: 100%;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 12px;

        margin-bottom: 45px;
    }

    .stat-card {
        min-height: 125px;
    }

    .dashboard-section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .message-grid {
        grid-template-columns: 1fr;
    }

    .message-card {
        min-height: 245px;
    }

}

@media (max-width: 380px) {

    .dashboard-welcome h1 {
        font-size: 2rem;
    }

    .message-card {
        padding: 19px;
    }

    .status {
        font-size: 0.65rem;
        padding: 5px 8px;
    }

}


/* =========================================
   LOGIN & REGISTRATION PAGES
========================================= */

.auth-page {
    width: 100%;
    max-width: 520px;
    margin: 35px auto 55px;
    padding: 20px;
}

.auth-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 44px 42px;
    box-shadow: 0 12px 40px rgba(23, 40, 33, 0.065);
}

.auth-heading {
    text-align: center;
    margin-bottom: 34px;
}

.auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 25px;
}

.auth-heading .eyebrow {
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.auth-heading h1 {
    margin: 0 auto 13px;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: clamp(29px, 5vw, 36px);
    font-weight: 500;
    line-height: 1.2;
}

.auth-description {
    max-width: 340px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 21px;
}

.auth-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.auth-form label {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    min-height: 49px;
    padding: 13px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    outline: none;
    background: #FDFDFC;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease,
                box-shadow 0.2s ease,
                background 0.2s ease;
}

.auth-form input::placeholder {
    color: #AAA99F;
}

.auth-form input:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(23, 60, 50, 0.10);
}

.auth-form input:focus-visible {
    outline: none;
}

.field-hint {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 51px;
    margin-top: 5px;
    border: none;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.auth-submit span {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.auth-submit:hover span {
    transform: translateX(4px);
}

.auth-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 29px;
    padding-top: 23px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-switch a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.auth-quote {
    margin: 25px 0 0;
    color: var(--text-secondary);
    font-family: "Playfair Display", serif;
    font-size: 14px;
    font-style: italic;
    text-align: center;
}


/* Auth responsive layout */

@media (max-width: 600px) {

    .auth-page {
        margin: 15px auto 35px;
        padding: 14px;
    }

    .auth-card {
        padding: 34px 25px;
        border-radius: 15px;
    }

    .auth-heading {
        margin-bottom: 28px;
    }

    .auth-heading h1 {
        font-size: 30px;
    }

}

@media (max-width: 380px) {

    .auth-card {
        padding: 29px 19px;
    }

    .auth-heading h1 {
        font-size: 27px;
    }

}


/* =========================================
   CREATE LETTER PAGE
========================================= */

.create-page {
    width: 100%;
    max-width: 850px;
    margin: 30px auto 65px;
    padding: 20px;
}

.create-heading {
    text-align: center;
    margin-bottom: 35px;
}

.create-heading .eyebrow {
    margin-bottom: 13px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.create-heading h1 {
    margin: 0 0 13px;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: clamp(32px, 5vw, 43px);
    font-weight: 500;
    line-height: 1.2;
}

.create-heading > p:last-child {
    max-width: 490px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.create-card {
    padding: 40px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 12px 40px rgba(23, 40, 33, 0.055);
}

.create-card form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.create-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.create-field > label {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.create-field input[type="text"],
.create-field input[type="datetime-local"],
.create-field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    outline: none;
    background: #FDFDFC;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease,
                box-shadow 0.2s ease,
                background 0.2s ease;
}

.create-field input[type="text"],
.create-field input[type="datetime-local"] {
    min-height: 50px;
}

.create-field textarea {
    min-height: 230px;
    resize: vertical;
    line-height: 1.85;
}

.create-field input::placeholder,
.create-field textarea::placeholder {
    color: #AAA99F;
}

.create-field input:focus,
.create-field textarea:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(23, 60, 50, 0.09);
}

.field-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
}

.field-footer span:last-child {
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 600;
}


/* Unlock date section */

.unlock-field {
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #F1EFEB;
}

.unlock-intro {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 3px 0 8px;
}

.unlock-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 21px;
}

.unlock-intro strong {
    color: var(--text);
    font-size: 13px;
}

.unlock-intro p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.timezone-note {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.6;
}


/* Letter preview */

.create-preview-section {
    padding-top: 5px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 17px;
}

.preview-header .eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

.preview-header h2 {
    margin: 0;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: 23px;
    font-weight: 500;
}

.preview-label {
    padding: 7px 10px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}

.letter-preview {
    min-height: 190px;
    padding: 27px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #FDFDFC;
}

.preview-date {
    margin: 0 0 17px;
    color: var(--accent);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.letter-preview h3 {
    margin: 0 0 13px;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: 23px;
    font-weight: 500;
}

.letter-preview > p:last-child {
    margin: 0;
    color: #66665E;
    font-size: 13px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* Form actions */

.create-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;
    padding-top: 5px;
}

.create-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 53px;
    border: none;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.submit-arrow {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.create-submit:hover .submit-arrow {
    transform: translateX(4px);
}

.cancel-link {
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cancel-link:hover {
    color: var(--primary);
    text-decoration: underline;
}


/* Responsive layout */

@media (max-width: 600px) {

    .create-page {
        margin: 15px auto 40px;
        padding: 13px;
    }

    .create-heading {
        margin-bottom: 27px;
    }

    .create-heading h1 {
        font-size: 32px;
    }

    .create-card {
        padding: 25px 19px;
        border-radius: 13px;
    }

    .create-card form {
        gap: 25px;
    }

    .unlock-field {
        padding: 18px;
    }

    .preview-header h2 {
        font-size: 21px;
    }

    .letter-preview {
        padding: 21px;
    }

    .field-footer {
        font-size: 10px;
    }

}

@media (max-width: 380px) {

    .create-card {
        padding: 21px 15px;
    }

    .preview-label {
        font-size: 8px;
        padding: 6px 7px;
    }

}


/* =========================================
   INDIVIDUAL LETTER PAGE
========================================= */

.letter-page {
    width: 100%;
    max-width: 850px;
    margin: 30px auto 60px;
    padding: 20px;
}

.letter-card {
    margin-bottom: 25px;
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #FFFFFF;
    box-shadow: 0 10px 35px rgba(23, 40, 33, 0.055);
}

.letter-heading {
    text-align: center;
}

.letter-heading .letter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 22px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 24px;
}

.letter-heading .eyebrow,
.letter-card > .eyebrow {
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.letter-heading h1,
.locked-card h1 {
    margin: 0 0 14px;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: clamp(30px, 5vw, 39px);
    font-weight: 500;
    line-height: 1.25;
}

.opening-description,
.locked-description {
    max-width: 470px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}


/* Envelope area */

.envelope-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 55px 15px 20px;
}

.open-letter-button {
    min-width: 210px;
    border: none;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.open-letter-button:disabled {
    cursor: wait;
    opacity: 0.75;
}


/* Letter reveal */

.letter-reveal {
    max-width: 650px;
    margin: 45px auto 5px;
    padding: 35px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #FDFDFC;
    text-align: center;
    animation: letterFadeIn 0.7s ease both;
}

.letter-reveal[hidden] {
    display: none;
}

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

.letter-divider {
    width: 55px;
    height: 1px;
    margin: 20px auto;
    background: var(--accent);
}

.letter-reveal .eyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.letter-reveal h2 {
    margin: 18px 0;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: clamp(25px, 4vw, 34px);
    font-weight: 500;
}

.letter-body {
    color: #45463F;
    font-family: "Playfair Display", serif;
    font-size: 16px;
    line-height: 2;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.unlocked-note {
    margin: 30px 0 0;
    color: #56745D;
    font-size: 12px;
    font-weight: 600;
}


/* Locked letter */

.locked-card {
    padding: 55px 35px;
    text-align: center;
    background: #FDFDFC;
}

.locked-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 25px;
    border-radius: 50%;
    background: var(--primary-light);
    font-size: 25px;
}

.lock-status {
    max-width: 390px;
    margin: 32px auto 25px;
    padding: 27px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #FFFFFF;
}

.lock-label {
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.lock-status h2 {
    margin: 15px 0 5px;
    color: var(--primary);
    font-family: "Playfair Display", serif;
    font-size: 27px;
    font-weight: 500;
}

.lock-status > p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.locked-footer {
    margin: 0;
    color: var(--text-secondary);
    font-family: "Playfair Display", serif;
    font-size: 15px;
    font-style: italic;
}


/* Share section */

.share-card h2,
.delete-card h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: 26px;
    font-weight: 500;
}

.share-description,
.share-card > p:not(.eyebrow),
.delete-card > p:not(.eyebrow) {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.share-link-section {
    margin: 25px 0;
}

.share-link-section label {
    display: block;
    margin-bottom: 9px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.share-link-row {
    display: flex;
    gap: 10px;
}

.share-link-row input {
    flex: 1;
    min-width: 0;
    min-height: 45px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #FDFDFC;
    color: #55564E;
    font-size: 12px;
}

.share-link-row button {
    flex-shrink: 0;
}

.share-form {
    margin-top: 17px;
}

.share-privacy,
.share-revoke {
    margin-top: 28px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.share-privacy h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: 20px;
    font-weight: 500;
}

.share-privacy > p,
.share-revoke .hint,
.share-card .hint {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.share-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 15px 0;
    color: #45463F;
    font-size: 13px;
}

.share-checkbox input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}


/* Delete section */

.delete-card {
    border-color: #E9DCD6;
    background: #FFFDFC;
}

.delete-card .eyebrow {
    color: #A56C5B;
}

.danger-button {
    padding: 11px 19px;
    border: 1px solid #D9BDB3;
    border-radius: 8px;
    background: #FFFFFF;
    color: #9A5548;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.danger-button:hover {
    background: #9A5548;
    color: #FFFFFF;
}


/* Back link */

.back-link {
    display: inline-block;
    margin: 5px 0 0;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover {
    color: var(--accent);
}


/* Responsive */

@media (max-width: 600px) {

    .letter-page {
        margin: 15px auto 40px;
        padding: 13px;
    }

    .letter-card {
        padding: 28px 20px;
        border-radius: 13px;
    }

    .locked-card {
        padding: 38px 19px;
    }

    .letter-reveal {
        padding: 24px 19px;
    }

    .letter-body {
        font-size: 15px;
        line-height: 1.9;
    }

    .share-link-row {
        flex-direction: column;
    }

    .share-link-row button {
        width: 100%;
    }

    .lock-status h2 {
        font-size: 24px;
    }

}

@media (max-width: 380px) {

    .letter-card {
        padding: 23px 16px;
    }

    .letter-heading h1,
    .locked-card h1 {
        font-size: 29px;
    }

}


/* Larger countdown text on the individual letter page */

.countdown {
    display: block;
    width: fit-content;

    margin: 22px auto 19px;
    padding: 5px 10px;

    background: var(--surface-soft);
    border-radius: 7px;

    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 600;
    text-align: center;
}

.lock-status .countdown {
    margin: 22px auto 19px;
    padding: 5px 10px;

    border-top: 1px solid var(--border);

    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.letter-page .countdown {
    font-size: 0.95rem;
}

.logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.logout-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;

    color: inherit;
    font: inherit;
    cursor: pointer;

    transition: inherit;
}

.logout-link:hover {
    color: inherit;
}


/* =========================================================
   OPENWHEN — SHARED LETTER PAGE
   Royal & Premium
   ========================================================= */

.share-page {
    width: 100%;
    min-height: 75vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 55px 20px;
}

.share-card {
    width: 100%;
    max-width: 540px;

    margin: 0 auto;
    padding: 42px 38px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;

    text-align: center;

    box-shadow: 0 12px 35px rgba(23, 60, 50, 0.09);
}

.share-icon {
    font-size: 2.5rem;
    margin-bottom: 18px;
}

.share-card .eyebrow {
    margin-bottom: 14px;

    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.share-card h1 {
    margin-bottom: 15px;

    color: var(--text);
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    line-height: 1.35;
}

.share-sender {
    margin-bottom: 24px;

    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.share-sender strong {
    color: var(--primary);
}

.share-divider {
    width: 55px;
    height: 1px;

    margin: 0 auto 27px;

    background: var(--accent);
}

.share-letter-preview {
    padding: 25px 22px;

    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;

    text-align: center;
}

.share-label {
    display: block;

    margin-bottom: 12px;

    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.share-letter-preview h2 {
    margin-bottom: 20px;

    color: var(--primary);
    font-family: "Playfair Display", serif;
    font-size: 1.55rem;
    line-height: 1.4;

    overflow-wrap: anywhere;
}

.share-unlock-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;

    margin: 0;

    color: var(--text-secondary);
    font-size: 0.85rem;
}

.share-unlock-date strong {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
}

.share-description {
    max-width: 410px;

    margin: 25px auto;

    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.8;
}

.share-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;

    margin: 25px 0 18px;
}

.share-actions .primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 280px;

    text-align: center;
    text-decoration: none;
}

.share-card form {
    margin: 25px 0 18px;
}

.share-card form .primary-button {
    width: 100%;
    max-width: 280px;
}

.share-login-link {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;

    text-decoration: none;
    transition: color 0.2s ease;
}

.share-login-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.share-card .hint {
    margin: 15px auto 20px;

    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.7;
}

.share-privacy {
    margin: 25px 0 0;
    padding-top: 18px;

    border-top: 1px solid var(--border);

    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.7;
}


/* Mobile adjustments */

@media (max-width: 600px) {

    .share-page {
        min-height: auto;
        padding: 35px 15px;
    }

    .share-card {
        padding: 32px 22px;
        border-radius: 15px;
    }

    .share-card h1 {
        font-size: 1.65rem;
    }

    .share-letter-preview {
        padding: 22px 16px;
    }

    .share-letter-preview h2 {
        font-size: 1.35rem;
    }

}


/* =========================================================
   OPENWHEN — MIDNIGHT ROYAL THEME
   Deep Emerald | Antique Gold | Luxury Dark
   Append this block at the END of style.css
   ========================================================= */


/* ---------------------------------------------------------
   1. DARK DESIGN TOKENS
   --------------------------------------------------------- */

:root {
    --background: #101A17;
    --surface: #192722;
    --surface-soft: #202F29;
    --surface-sage: #263A31;

    --primary: #B99A63;
    --primary-dark: #A28450;
    --primary-light: #34483B;

    --text: #EAE4D8;
    --text-secondary: #B0B5AC;
    --text-light: #858F85;

    --border: #304138;
    --border-strong: #405448;

    --accent: #C5A46D;
    --success: #82B58B;
    --danger: #D47B70;
    --warning: #C9A56B;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 45px rgba(0, 0, 0, 0.32);
}


/* ---------------------------------------------------------
   2. GLOBAL
   --------------------------------------------------------- */

body {
    background: var(--background);
    color: var(--text);
}

h1,
h2,
h3,
h4 {
    color: var(--text);
}

p {
    color: var(--text-secondary);
}

::selection {
    background: #425B4B;
    color: #F5EFE3;
}


/* ---------------------------------------------------------
   3. NAVIGATION
   --------------------------------------------------------- */

.site-header {
    background: rgba(16, 26, 23, 0.94);
    border-bottom-color: var(--border);
}

.logo {
    color: var(--text);
}

.logo-mark {
    background: var(--accent);
    color: #101A17;
}

.nav-link {
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--accent);
}

.nav-create,
.nav-register {
    background: var(--accent);
    color: #101A17;
}

.nav-create:hover,
.nav-register:hover {
    background: #D2B47F;
    color: #101A17;
}

.nav-logout {
    color: var(--danger);
}

.nav-logout:hover {
    color: #F09A8D;
}


/* ---------------------------------------------------------
   4. BUTTONS
   --------------------------------------------------------- */

.primary-button,
.button-primary {
    background: var(--accent);
    color: #101A17;
}

.primary-button:hover,
.button-primary:hover {
    background: #D2B47F;
    color: #101A17;
}

.secondary-button,
.button-secondary {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border-strong);
}

.secondary-button:hover,
.button-secondary:hover {
    background: var(--surface-sage);
    border-color: var(--accent);
}

.danger-button {
    background: #382522;
    color: #E5A096;
    border-color: #674039;
}

.danger-button:hover {
    background: #513029;
    color: #F0B0A5;
}


/* ---------------------------------------------------------
   5. CARDS AND SURFACES
   --------------------------------------------------------- */

.card,
.content-card,
.feature-card,
.stat-card,
.message-card,
.auth-card,
.create-card,
.letter-card,
.share-card {
    background: var(--surface);
    border-color: var(--border);
}

.card,
.content-card,
.feature-card,
.stat-card,
.message-card {
    box-shadow: var(--shadow-sm);
}

.card-hover:hover,
.feature-card:hover,
.stat-card:hover,
.message-card:hover {
    box-shadow: var(--shadow-md);
}

.message-card:hover {
    border-color: #60765F;
}

.empty-state {
    background: var(--surface);
    border-color: var(--border-strong);
}


/* ---------------------------------------------------------
   6. FORMS AND INPUTS
   --------------------------------------------------------- */

input,
textarea,
select {
    background: #14211C;
    color: var(--text);
    border-color: var(--border-strong);
}

input::placeholder,
textarea::placeholder {
    color: #7E8980;
}

input:focus,
textarea:focus,
select:focus {
    background: #192922;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(197, 164, 109, 0.13);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark;
}


/* ---------------------------------------------------------
   7. FLASH MESSAGES AND STATUS
   --------------------------------------------------------- */

.flash {
    background: #1E3429;
    border-color: #365B43;
    color: #B6D7BA;
}

.flash-indicator {
    background: var(--success);
}

.badge-success,
.status-unlocked,
.status.unlocked {
    background: #233B2C;
    color: #A5D0A9;
}

.badge-warning,
.status-locked,
.status.locked {
    background: #3A3020;
    color: #D8B77D;
}

.badge-danger {
    background: #402823;
    color: #E4A098;
}


/* ---------------------------------------------------------
   8. UTILITIES
   --------------------------------------------------------- */

.eyebrow {
    color: var(--accent);
}

.text-primary {
    color: var(--accent);
}

.divider {
    background: var(--border);
}


/* ---------------------------------------------------------
   9. FOOTER
   --------------------------------------------------------- */

.site-footer {
    background: #0C1512;
    border-top-color: var(--border);
}

.footer-brand {
    color: var(--text);
}

.footer-message {
    color: var(--text-secondary);
}

.footer-copyright {
    color: var(--text-light);
}


/* ---------------------------------------------------------
   10. HOMEPAGE — HERO
   --------------------------------------------------------- */

.hero-content h1 span {
    color: var(--accent);
}

.hero-secondary-link {
    color: var(--text-secondary);
}

.hero-secondary-link span {
    color: var(--accent);
}

.hero-note {
    color: var(--text-light);
}

.hero-note-icon {
    color: var(--accent);
}


/* Hero letter illustration */

.letter-decoration {
    background: #263A30;
}

.letter-decoration-middle {
    background: #304337;
}

.hero-letter {
    background: #26352D;
    border-color: #52634F;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.35);
}

.letter-small-label {
    color: #A6AC9F;
}

.letter-symbol,
.letter-stamp {
    color: var(--accent);
}

.letter-divider {
    background: #52604F;
}

.letter-greeting,
.letter-signature {
    color: #E6D6B8;
}

.letter-message {
    color: #C1C2B7;
}

.letter-bottom {
    color: #A6AC9F;
}

.letter-stamp {
    border-color: #A88D5D;
}

.hero-floating-note {
    background: #26352D;
    border-color: var(--border-strong);
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
}


/* Homepage introduction */

.section-heading h2 span {
    color: var(--accent);
}


/* Feature cards */

.feature-card {
    background: var(--surface);
    border-color: var(--border);
}

.feature-number {
    color: #526057;
}

.feature-icon {
    background: #2B4035;
    color: var(--accent);
}


/* Homepage closing section */

.home-closing {
    background: #1B3027;
    border-color: #344E3D;
}

.closing-decoration {
    color: var(--accent);
}


/* ---------------------------------------------------------
   11. DASHBOARD
   --------------------------------------------------------- */

.stat-icon,
.message-symbol,
.empty-illustration {
    background: #2B4035;
    color: var(--accent);
}

.stat-locked .stat-icon {
    background: #3A3020;
    color: #D8B77D;
}

.stat-unlocked .stat-icon {
    background: #233B2C;
    color: #A5D0A9;
}

.message-total {
    background: var(--surface-soft);
    color: var(--text-secondary);
}

.message-origin {
    color: var(--text-light);
}

.card-date {
    color: var(--text-secondary);
}

.message-card-footer {
    border-top-color: var(--border);
}

.card-open-link {
    color: var(--accent);
}

.card-arrow {
    color: var(--accent);
}

.dashboard-empty {
    background: #17251F;
    border-color: var(--border-strong);
}


/* ---------------------------------------------------------
   12. LOGIN AND REGISTRATION
   --------------------------------------------------------- */

.auth-card {
    background: #192722;
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

.auth-icon {
    background: #34483B;
    color: var(--accent);
}

.auth-heading .eyebrow {
    color: var(--accent);
}

.auth-heading h1 {
    color: var(--text);
}

.auth-description {
    color: var(--text-secondary);
}

.auth-form label {
    color: var(--text);
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    background: #14211C;
    color: var(--text);
    border-color: var(--border-strong);
}

.auth-form input::placeholder {
    color: #7E8980;
}

.auth-form input:focus {
    background: #192922;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(197, 164, 109, 0.13);
}

.field-hint {
    color: var(--text-light);
}

.auth-switch {
    border-top-color: var(--border);
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
}

.auth-switch a:hover {
    color: #D9BD8D;
}

.auth-quote {
    color: var(--text-secondary);
}


/* ---------------------------------------------------------
   13. CREATE LETTER PAGE
   --------------------------------------------------------- */

.create-card {
    background: #192722;
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

.create-heading .eyebrow {
    color: var(--accent);
}

.create-field > label {
    color: var(--text);
}

.create-field input[type="text"],
.create-field input[type="datetime-local"],
.create-field textarea {
    background: #14211C;
    color: var(--text);
    border-color: var(--border-strong);
}

.create-field input::placeholder,
.create-field textarea::placeholder {
    color: #7E8980;
}

.create-field input:focus,
.create-field textarea:focus {
    background: #192922;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(197, 164, 109, 0.13);
}

.field-footer {
    color: var(--text-secondary);
}

.field-footer span:last-child {
    color: var(--accent);
}


/* Unlock date section */

.unlock-field {
    background: #202F29;
    border-color: var(--border);
}

.unlock-symbol {
    background: #34483B;
    color: var(--accent);
}

.unlock-intro strong {
    color: var(--text);
}

.unlock-intro p,
.timezone-note {
    color: var(--text-secondary);
}


/* Preview */

.preview-header .eyebrow {
    color: var(--accent);
}

.preview-label {
    background: #34483B;
    color: #D7BD8B;
}

.letter-preview {
    background: #202F29;
    border-color: var(--border-strong);
}

.preview-date {
    color: var(--accent);
}

.letter-preview h3 {
    color: var(--text);
}

.letter-preview > p:last-child {
    color: #C1C4B9;
}

.cancel-link {
    color: var(--text-secondary);
}

.cancel-link:hover {
    color: var(--accent);
}


/* ---------------------------------------------------------
   14. INDIVIDUAL LETTER PAGE
   --------------------------------------------------------- */

.letter-card {
    background: #192722;
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

.letter-heading .letter-icon {
    background: #34483B;
    color: var(--accent);
}

.letter-heading .eyebrow,
.letter-card > .eyebrow {
    color: var(--accent);
}

.opening-description,
.locked-description {
    color: var(--text-secondary);
}


/* Letter reveal */

.letter-reveal {
    background: #202F29;
    border-color: var(--border-strong);
}

.letter-reveal .eyebrow {
    color: var(--accent);
}

.letter-reveal h2 {
    color: var(--text);
}

.letter-body {
    color: #D1D0C5;
}

.letter-divider {
    background: var(--accent);
}

.unlocked-note {
    color: #91BB98;
}


/* Locked letter */

.locked-card {
    background: #192722;
}

.locked-icon {
    background: #34483B;
    color: var(--accent);
}

.lock-status {
    background: #202F29;
    border-color: var(--border-strong);
}

.lock-label {
    color: var(--accent);
}

.lock-status h2 {
    color: var(--accent);
}

.lock-status > p {
    color: var(--text-secondary);
}

.locked-footer {
    color: var(--text-secondary);
}


/* Share section */

.share-card h2,
.delete-card h2 {
    color: var(--text);
}

.share-description,
.share-card > p:not(.eyebrow),
.delete-card > p:not(.eyebrow) {
    color: var(--text-secondary);
}

.share-link-section label {
    color: var(--text);
}

.share-link-row input {
    background: #14211C;
    border-color: var(--border-strong);
    color: var(--text);
}

.share-privacy,
.share-revoke {
    border-top-color: var(--border);
}

.share-privacy h3 {
    color: var(--text);
}

.share-privacy > p,
.share-revoke .hint,
.share-card .hint {
    color: var(--text-secondary);
}

.share-checkbox {
    color: var(--text);
}

.share-checkbox input {
    accent-color: var(--accent);
}


/* Delete section */

.delete-card {
    background: #29221F;
    border-color: #624039;
}

.delete-card .eyebrow {
    color: #D28B7B;
}

.delete-button,
.danger-button {
    background: #382522;
    border-color: #674039;
    color: #E5A096;
}

.danger-button:hover {
    background: #8E493F;
    color: #FFFFFF;
}


/* Back link */

.back-link {
    color: var(--accent);
}

.back-link:hover {
    color: #D9BD8D;
}


/* Countdown */

.countdown {
    background: #263A31;
    color: var(--accent);
}

.lock-status .countdown {
    border-top-color: var(--border);
    color: var(--accent);
}


/* ---------------------------------------------------------
   15. SHARED LETTER PAGE
   --------------------------------------------------------- */

.share-card {
    background: #192722;
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

.share-card .eyebrow {
    color: var(--accent);
}

.share-card h1 {
    color: var(--text);
}

.share-sender {
    color: var(--text-secondary);
}

.share-sender strong {
    color: var(--accent);
}

.share-divider {
    background: var(--accent);
}

.share-letter-preview {
    background: #202F29;
    border-color: var(--border-strong);
}

.share-label {
    color: var(--accent);
}

.share-letter-preview h2 {
    color: var(--text);
}

.share-unlock-date {
    color: var(--text-secondary);
}

.share-unlock-date strong {
    color: var(--text);
}

.share-description {
    color: var(--text-secondary);
}

.share-login-link {
    color: var(--accent);
}

.share-login-link:hover {
    color: #D9BD8D;
}

.share-card .hint {
    color: var(--text-secondary);
}

.share-privacy {
    border-top-color: var(--border);
    color: var(--text-secondary);
}


/* ---------------------------------------------------------
   16. ACCESSIBILITY AND FOCUS
   --------------------------------------------------------- */

:focus-visible {
    outline: 3px solid rgba(197, 164, 109, 0.65);
    outline-offset: 3px;
}


/* ---------------------------------------------------------
   17. SCROLLBAR
   --------------------------------------------------------- */

* {
    scrollbar-width: thin;
    scrollbar-color: #526557 #14211C;
}

*::-webkit-scrollbar {
    width: 9px;
}

*::-webkit-scrollbar-track {
    background: #14211C;
}

*::-webkit-scrollbar-thumb {
    background: #526557;
    border-radius: 20px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #71836F;
}


/* ---------------------------------------------------------
   18. FINAL POLISH
   --------------------------------------------------------- */

.logo-text,
.footer-brand {
    color: var(--text);
}

.nav-create,
.nav-register,
.primary-button,
.button-primary,
.auth-submit,
.create-submit {
    font-weight: 700;
}

button:disabled,
.button:disabled {
    opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}

/* Consistent spacing between individual letter sections */

.letter-page > .letter-card {
    margin-bottom: 25px;
}

.letter-page > .letter-card:last-of-type {
    margin-bottom: 25px;
}
