* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #1a1410;
    --paper: #f5f0e8;
    --paper2: #ede8dd;
    --red: #c0392b;
    --amber: #d4820a;
    --teal: #1a6b5c;
    --border: #b8ad9e;
    --muted: #7a7060;
    --tape: rgba(255, 235, 150, 0.55);
}

body {
    min-height: 100vh;
    font-family: 'Syne', sans-serif;
    background-color: #c8a96e;
    background-image: radial-gradient(circle at 15% 15%, #d4b580 0%, transparent 45%),
                      radial-gradient(circle at 85% 85%, #b8964e 0%, transparent 45%),
                      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23c8a96e'/%3E%3Ccircle cx='1' cy='1' r='0.6' fill='%23b0893a' opacity='0.35'/%3E%3Ccircle cx='3' cy='3' r='0.5' fill='%23d4b070' opacity='0.25'/%3E%3Ccircle cx='3' cy='1' r='0.3' fill='%23a07830' opacity='0.2'/%3E%3C/svg%3E");
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Decorative red string */
.string-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

/* Navbar for auth pages */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--ink);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    flex-wrap: wrap;
}

.logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1.45rem;
    color: var(--paper);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.logo-dot {
    width: 9px;
    height: 9px;
    background: var(--red);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(192, 57, 43, 0.8);
    animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    color: #888070;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 0.8rem;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
    color: #d0c8b8;
}

.nav-links a.active {
    color: var(--paper);
    border-bottom-color: var(--red);
}

/* Auth Box - Pinned paper style */
.auth-box {
    background: #fffef5;
    border: 1px solid #d8cdb8;
    width: 100%;
    max-width: 450px;
    padding: 2.5rem 2rem 2rem;
    position: relative;
    z-index: 2;
    box-shadow: 12px 14px 0 rgba(0, 0, 0, 0.15);
    transform: rotate(0.5deg);
    transition: transform 0.2s;
    margin: 5rem 1rem 1rem;
}

.auth-box:hover {
    transform: rotate(0deg) translateY(-4px);
}

/* Pin decoration */
.pin-red {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #e05a4a, #9e2d1f);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

.pin-red::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 30px;
    background: linear-gradient(180deg, #6b5a4a, #2a241e);
    top: 22px;
    left: 10px;
    border-radius: 0 0 2px 2px;
}

/* Tape strip at corner */
.tape-corner {
    position: absolute;
    top: -10px;
    left: 20px;
    width: 65px;
    height: 26px;
    background: var(--tape);
    border: 1px solid rgba(200, 180, 90, 0.45);
    transform: rotate(-3deg);
    pointer-events: none;
}

/* Auth header */
.auth-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

.auth-header i {
    font-size: 2.8rem;
    color: var(--teal);
    background: #efe6d6;
    width: 75px;
    height: 75px;
    line-height: 75px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 2px solid #ddd2be;
    box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.1);
}

.auth-header h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.9rem;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.auth-header p {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 6px;
}

/* Form styles */
.auth-box input {
    width: 100%;
    background: #fefaf0;
    border: 1px solid #ddd2be;
    padding: 14px 16px;
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    color: var(--ink);
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.auth-box input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 107, 92, 0.15);
}

.auth-box input::placeholder {
    color: #b8aa92;
    font-family: 'Syne', sans-serif;
    font-size: 0.8rem;
}

/* Button */
.btn-primary {
    background: var(--ink);
    border: none;
    width: 100%;
    padding: 14px;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 60px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 8px;
    box-shadow: 0 3px 0 #2f241f;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #2f241f;
    background: #2a201b;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 #2f241f;
}

/* Footer links */
.auth-footer {
    text-align: center;
    margin-top: 1.8rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    border-top: 1px dashed #e2d8c4;
    padding-top: 1.2rem;
}

.auth-footer a {
    color: var(--teal);
    text-decoration: none;
    font-weight: 600;
    transition: 0.15s;
}

.auth-footer a:hover {
    color: var(--red);
    text-decoration: underline;
}

/* Toast message */
.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a1410;
    backdrop-filter: blur(12px);
    border: 1px solid #c8b690;
    padding: 10px 24px;
    border-radius: 60px;
    color: #f5eedc;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    z-index: 200;
    transition: 0.25s;
    pointer-events: none;
    white-space: nowrap;
}

.toast-msg.show {
    transform: translateX(-50%) translateY(0);
}

/* Decorative elements */
.sticker {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 0.7rem;
    font-family: 'DM Mono', monospace;
    background: rgba(255, 254, 245, 0.6);
    padding: 6px 14px;
    border-radius: 30px;
    color: var(--muted);
    pointer-events: none;
    z-index: 1;
    backdrop-filter: blur(4px);
}

@media (max-width: 800px) {
    .navbar {
        padding: 0 0.8rem;
    }
    .nav-links a {
        padding: 0 0.5rem;
        font-size: 0.55rem;
    }
}

@media (max-width: 650px) {
    .navbar {
        height: auto;
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
        position: relative;
    }
    .nav-links a {
        height: 40px;
    }
    .auth-box {
        margin: 7rem 1rem 1rem;
    }
}

@media (max-width: 500px) {
    .auth-box {
        padding: 2rem 1.5rem;
        margin: 8rem 1rem 1rem;
    }
    .toast-msg {
        white-space: normal;
        text-align: center;
        max-width: 85%;
    }
}