@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Neucha&display=swap');

:root {
    --bg-desk: #2b1f1d;
    --paper-color: #fbf9f4;
    --grid-line: rgba(72, 118, 255, 0.14);
    --margin-line: rgba(231, 76, 60, 0.35);
    --ink-color: #1a252f;
    --pencil-color: #4a5568;
    --accent-gold: #f39c12;
}

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

body {
    background-color: var(--bg-desk);
    background-image:
        radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
        repeating-linear-gradient(45deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 2px, transparent 2px, transparent 8px);
    font-family: 'Neucha', 'Comic Sans MS', cursive, sans-serif;
    color: var(--ink-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-sheet {
    position: relative;
    width: 100%;
    max-width: 470px;
    background-color: var(--paper-color);
    background-image:
        linear-gradient(90deg, transparent 48px, var(--margin-line) 48px, var(--margin-line) 50px, transparent 50px),
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px, 24px 24px;
    border-radius: 12px;
    padding: 34px 32px 30px 66px;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(180, 160, 130, 0.35);
}

.login-spiral {
    position: absolute;
    left: 10px;
    top: 22px;
    bottom: 22px;
    width: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.spiral-ring {
    width: 20px;
    height: 10px;
    border: 2.5px solid #5c6670;
    border-radius: 10px;
    background: linear-gradient(180deg, #e2e8f0, #94a3b8);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.login-badge {
    display: inline-block;
    background: #fef3c7;
    border: 1.5px dashed #d97706;
    color: #92400e;
    font-size: 0.9em;
    padding: 3px 12px;
    border-radius: 16px;
    margin-bottom: 10px;
}

.login-title {
    font-family: 'Caveat', cursive;
    font-size: 2.25em;
    line-height: 1.1;
    color: #1a252f;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 1em;
    color: var(--pencil-color);
    line-height: 1.4;
    margin-bottom: 22px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group label {
    font-size: 1.05em;
    color: #2c3e50;
}

.field-group input {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Neucha', sans-serif;
    font-size: 1.08em;
    color: #1a252f;
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid #94a3b8;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group input:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    padding-right: 44px;
}

.toggle-pass-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.15em;
    padding: 4px 6px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.toggle-pass-btn:hover {
    opacity: 1;
}

.login-error {
    display: none;
    background: #fef2f2;
    border: 1.5px solid #ef4444;
    color: #b91c1c;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.98em;
    line-height: 1.35;
}

.login-error.visible {
    display: block;
}

.login-submit-btn {
    margin-top: 4px;
    background: linear-gradient(135deg, #d35400, #f39c12);
    border: 2px solid #b45309;
    color: #ffffff;
    font-family: 'Caveat', cursive;
    font-size: 1.55em;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.login-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(211, 84, 0, 0.45);
}

.login-submit-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.login-note {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed rgba(100, 116, 139, 0.4);
    font-size: 0.92em;
    color: #64748b;
    line-height: 1.4;
}

.auth-switch-box {
    margin-top: 14px;
    text-align: center;
}

.auth-switch-link {
    display: inline-block;
    color: #92400e;
    background: #fffbeb;
    border: 1px dashed #d97706;
    padding: 7px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.98em;
    transition: background 0.15s, transform 0.15s;
}

.auth-switch-link:hover {
    background: #fef3c7;
    transform: translateY(-1px);
}

.field-hint {
    font-size: 0.85em;
    color: #64748b;
}

.input-mono {
    font-family: 'Consolas', 'Courier New', monospace !important;
    letter-spacing: 0.04em;
}

@media (max-width: 520px) {
    .login-sheet {
        padding: 26px 20px 24px 52px;
    }
    .login-title {
        font-size: 1.9em;
    }
}
