/* ==========================================================================
   VOID GROUND - OLD SCHOOL JOURNAL BOOK LOGIN STYLING
   Theme: Antique Leather-Bound Laboratory Ledger & Aged Parchment Paper
   Standard: Zero Neon, Authentic Vintage Typography & Physical Textures
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Cinzel:wght@600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400;1,700&family=Special+Elite&display=swap');

/* --- Fullscreen Desk Overlay --- */
.journal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #100804;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(20, 10, 5, 0.45) 0%, rgba(13, 7, 4, 0.85) 75%, #050201 100%),
        url("assets/scholar-desk-login.jpg");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    padding: 24px;
    box-sizing: border-box;
    opacity: 1;
    visibility: visible;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.85);
}

.journal-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* --- The Open Leather Journal Book (+15% Scale: 1440px x 730px) --- */
.journal-book-wrapper {
    position: relative;
    width: 1440px;
    height: 730px;
    max-width: 1440px;
    max-height: 730px;
    display: flex;
    justify-content: center;
    perspective: 1500px;
}

.journal-book {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: #2b170c;
    background-image: 
        radial-gradient(ellipse at 50% 50%, rgba(70, 36, 17, 0.6) 0%, rgba(35, 17, 8, 0.9) 80%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='leather'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.2 0 0 0 0 0.1 0 0 0 0 0.05 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23leather)'/%3E%3C/svg%3E");
    border-radius: 20px;
    padding: 21px 31px;
    box-shadow: 
        0 28px 68px rgba(0, 0, 0, 0.95),
        0 12px 28px rgba(0, 0, 0, 0.85),
        inset 0 0 40px rgba(0, 0, 0, 0.9),
        inset 0 0 2px 1px rgba(184, 134, 76, 0.4);
    border: 2px solid #1a0c06;
    box-sizing: border-box;
}

/* Perimeter Leather Stitching */
.journal-book::before {
    content: '';
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 9px;
    right: 9px;
    border: 1.5px dashed rgba(184, 134, 76, 0.35);
    border-radius: 14px;
    pointer-events: none;
    z-index: 10;
}

/* Brass Ornate Corners (+15% Scale) */
.brass-corner {
    position: absolute;
    width: 55px;
    height: 55px;
    pointer-events: none;
    z-index: 15;
    background-repeat: no-repeat;
    background-size: contain;
}
.brass-corner-tl {
    top: 6px;
    left: 6px;
    border-top: 4.5px solid #b8864c;
    border-left: 4.5px solid #b8864c;
    border-top-left-radius: 12px;
    box-shadow: inset 1px 1px 0 #d4af37, -1px -1px 2px rgba(0,0,0,0.8);
}
.brass-corner-tr {
    top: 6px;
    right: 6px;
    border-top: 4.5px solid #b8864c;
    border-right: 4.5px solid #b8864c;
    border-top-right-radius: 12px;
    box-shadow: inset -1px 1px 0 #d4af37, 1px -1px 2px rgba(0,0,0,0.8);
}
.brass-corner-bl {
    bottom: 6px;
    left: 6px;
    border-bottom: 4.5px solid #b8864c;
    border-left: 4.5px solid #b8864c;
    border-bottom-left-radius: 12px;
    box-shadow: inset 1px -1px 0 #d4af37, -1px 1px 2px rgba(0,0,0,0.8);
}
.brass-corner-br {
    bottom: 6px;
    right: 6px;
    border-bottom: 4.5px solid #b8864c;
    border-right: 4.5px solid #b8864c;
    border-bottom-right-radius: 12px;
    box-shadow: inset -1px -1px 0 #d4af37, 1px 1px 2px rgba(0,0,0,0.8);
}

/* Bookmark Ribbon (+15% Scale) */
.journal-ribbon {
    position: absolute;
    top: -23px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 107px;
    background: linear-gradient(180deg, #7c1919 0%, #a32222 70%, #520d0d 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
    z-index: 25;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
    border-top: 1px solid #c24141;
}

/* --- Internal Paper Folio Spread --- */
.journal-spread {
    display: flex;
    width: 100%;
    height: 100%;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.75),
        inset 0 0 15px rgba(90, 50, 20, 0.3);
    position: relative;
    background-color: #f3ebda;
}

/* Individual Pages (Aged Parchment Paper +15% Scale) */
.journal-page {
    flex: 1;
    min-height: auto;
    height: 100%;
    padding: 24px 34px;
    box-sizing: border-box;
    position: relative;
    background-color: #f7f1e1;
    background-image: 
        /* Aged edge vignettes */
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.3) 0%, rgba(220, 200, 170, 0.4) 75%, rgba(185, 155, 120, 0.65) 100%),
        /* Horizontal blue-gray notebook ruling lines (46px spacing) */
        linear-gradient(to bottom, transparent 45px, rgba(120, 140, 160, 0.22) 46px);
    background-size: 100% 100%, 100% 46px;
    color: #2b1f18;
    overflow: hidden;
}

/* Left Page Depth Shadow */
.journal-page-left {
    border-right: 1px solid rgba(130, 95, 60, 0.25);
    box-shadow: inset -26px 0 28px -12px rgba(50, 25, 10, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Right Page Depth Shadow */
.journal-page-right {
    border-left: 1px solid rgba(130, 95, 60, 0.25);
    box-shadow: inset 26px 0 28px -12px rgba(50, 25, 10, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Central Gutter / Binding Shadow (+15% Scale) */
.journal-spine-gutter {
    width: 46px;
    background: linear-gradient(90deg, 
        rgba(30, 15, 6, 0.7) 0%, 
        rgba(50, 25, 10, 0.4) 25%, 
        rgba(20, 10, 4, 0.85) 50%, 
        rgba(50, 25, 10, 0.4) 75%, 
        rgba(30, 15, 6, 0.7) 100%
    );
    position: relative;
    z-index: 5;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    padding: 25px 0;
    box-sizing: border-box;
}

.spine-cord {
    width: 10px;
    height: 23px;
    background: #140803;
    border-radius: 4px;
    box-shadow: inset 0 0 2px #5a3821, 0 1px 2px rgba(0,0,0,0.8);
}

/* --- Left Page Elements: Classical Specimen & Stamp (Scaled Density) --- */
.journal-header-seal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    border-bottom: 2px solid #8c6846;
    padding-bottom: 7px;
}

.journal-ledger-number {
    font-family: 'Special Elite', monospace;
    font-size: 19px;
    letter-spacing: 2px;
    color: #6d4b2e;
    text-transform: uppercase;
    font-weight: bold;
}

.journal-date-tag {
    font-family: 'Special Elite', monospace;
    font-size: 18px;
    color: #8c6846;
    font-weight: bold;
}

.journal-left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    text-align: center;
    padding: 8px 0;
}

.journal-crest-icon {
    width: 86px;
    height: 86px;
    margin-bottom: 6px;
    color: #613e20;
    opacity: 0.88;
}

.journal-left-title {
    font-family: 'Cinzel', serif;
    font-size: 35px;
    font-weight: 800;
    color: #381e0e;
    letter-spacing: 3px;
    margin: 0 0 4px 0;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.4);
}

.journal-left-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 19.5px;
    font-style: italic;
    color: #6d4c33;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.journal-left-desc {
    font-family: 'Special Elite', monospace;
    font-size: 19.5px;
    line-height: 34px;
    color: #2f1e13;
    text-align: justify;
    margin: 0 0 16px 0;
}

/* Vintage Archival Rubber Stamp */
.vintage-stamp {
    border: 3.5px double #8a2424;
    color: #8a2424;
    padding: 11px 25px;
    font-family: 'Special Elite', monospace;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 4.5px;
    text-transform: uppercase;
    transform: rotate(-5deg);
    opacity: 0.88;
    margin-top: 10px;
    mask-image: radial-gradient(circle, black 70%, rgba(0,0,0,0.5) 100%);
    box-shadow: 0 0 0 2px rgba(138, 36, 36, 0.25);
    background-color: rgba(138, 36, 36, 0.04);
}

.vintage-signature-line {
    width: 100%;
    margin-top: 16px;
    border-top: 1.5px solid #7d5939;
    padding-top: 9px;
    display: flex;
    justify-content: space-between;
    font-family: 'Special Elite', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #7d5939;
}

/* --- Right Page Elements: Access Ledger Form (Scaled Density) --- */
.journal-right-header {
    border-bottom: 2px solid #8c6846;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.journal-form-title {
    font-family: 'Cinzel', serif;
    font-size: 31px;
    font-weight: 800;
    color: #381e0e;
    letter-spacing: 2px;
    margin: 0;
}

.journal-form-subtitle {
    display: none !important;
}

/* Tab Navigation (Vintage Bookmark Tabs) */
.journal-tabs {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    border-bottom: 2px solid #ab8c6e;
    padding-bottom: 7px;
}

.journal-tab-btn {
    background: none;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 19.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #8c6e54;
    padding: 9px 20px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease;
    position: relative;
}

.journal-tab-btn:hover {
    color: #3a2214;
    background-color: rgba(140, 104, 70, 0.1);
}

.journal-tab-btn.active {
    color: #2b170c;
    background-color: rgba(140, 104, 70, 0.22);
    border-bottom: 2px solid #5a3821;
}

/* Form Groups & Ledger Inputs (Prominently Enlarged for High Legibility) */
.journal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.journal-form.hidden {
    display: none;
}

.journal-form-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.journal-label {
    font-family: 'Special Elite', monospace;
    font-size: 21px;
    letter-spacing: 1.3px;
    font-weight: 700;
    color: #3b2516;
    text-transform: uppercase;
}

.journal-input {
    background: rgba(255, 255, 255, 0.6);
    border: 1.8px solid #a88d72;
    border-bottom: 3.5px solid #5c3c24;
    border-radius: 7px;
    padding: 18px 22px;
    font-family: 'Special Elite', monospace;
    font-size: 23px;
    color: #1f140d;
    box-sizing: border-box;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.journal-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    border-color: #5c3c24;
    border-bottom: 4px solid #361f10;
    box-shadow: 0 0 0 3px rgba(92, 60, 36, 0.18);
}

.journal-input::placeholder {
    color: #9c826c;
    font-style: italic;
    opacity: 0.7;
    font-size: 20px;
}

/* Ledger Submit Button */
.journal-submit-btn {
    margin-top: 12px;
    background: linear-gradient(180deg, #6c4222 0%, #4a2b13 100%);
    color: #f7ebd9;
    border: 2px solid #8e623b;
    border-radius: 6px;
    padding: 18px 24px;
    font-family: 'Cinzel', serif;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 
        0 5px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.journal-submit-btn:hover {
    background: linear-gradient(180deg, #7c4c28 0%, #563318 100%);
    border-color: #ad784a;
    box-shadow: 
        0 6px 14px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.journal-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

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

/* Feedback / Status Messages */
.journal-message {
    min-height: 32px;
    margin-top: 10px;
    font-family: 'Special Elite', monospace;
    font-size: 16.5px;
    text-align: center;
    padding: 8px 14px;
    border-radius: 5px;
    display: none;
    line-height: 1.4;
}

.journal-right-signature {
    margin-top: auto;
}

.journal-message.show {
    display: block;
}

.journal-message.error {
    background-color: rgba(146, 38, 38, 0.12);
    border: 1px dashed #922626;
    color: #8c1e1e;
}

.journal-message.success {
    background-color: rgba(46, 117, 57, 0.12);
    border: 1px dashed #2e7539;
    color: #245e2d;
}

/* Spinner Icon */
.journal-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(247, 235, 217, 0.3);
    border-top-color: #f7ebd9;
    border-radius: 50%;
    animation: journal-spin 0.8s linear infinite;
    display: inline-block;
}

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

/* --- Active User Badge (in Toolbox Header) --- */
.user-auth-badge {
    display: none !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: linear-gradient(180deg, rgba(38, 18, 8, 0.92) 0%, rgba(22, 10, 4, 0.95) 100%);
    border: 1px solid rgba(184, 134, 76, 0.38);
    border-radius: 7px;
    padding: 8px 14px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.35);
    margin-bottom: 10px;
    box-sizing: border-box;
    width: 100%;
}

.user-badge-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-badge-label {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 11px;
    text-transform: uppercase;
    color: #9f7d58;
    letter-spacing: 0.8px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.user-badge-name {
    font-family: 'Special Elite', 'Georgia', monospace;
    font-size: 18px;
    color: #f2e2c4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    text-shadow: 0 1px 2px #0a0402;
    line-height: 1.2;
}

.user-badge-capacity {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 14px;
    border-left: 1px solid rgba(184, 134, 76, 0.25);
    border-right: 1px solid rgba(184, 134, 76, 0.25);
    flex-shrink: 0;
}

.user-badge-capacity .user-badge-label {
    font-size: 11px;
    color: #a6845d;
    margin-bottom: 2px;
    white-space: nowrap;
}

.void-capacity-badge {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #f0dba8;
    background: #140702;
    border: 1px solid #734526;
    border-radius: 12px;
    padding: 2px 10px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: all 0.25s ease;
}

.void-capacity-badge.full {
    color: #ff8585;
    background: #2b0b0b;
    border-color: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.5), inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

.user-logout-btn {
    background: linear-gradient(180deg, #441e12 0%, #2a1109 100%);
    border: 1px solid #85492a;
    color: #edd6a4;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-logout-btn:hover {
    background: linear-gradient(180deg, #5c2817 0%, #3a170d 100%);
    border-color: #b0653b;
    color: #fff1cc;
    transform: translateY(-1px);
}

/* --- Responsive Adjustments ---
   Scaled uniformly by universal 1920x864 canvas scaler.
   No conflicting vh/vw media queries needed. */

/* Vertical Stacking ONLY for Narrow Portrait Screens */
@media (max-width: 720px) and (orientation: portrait) {
    .journal-book-wrapper {
        min-height: auto;
    }
    .journal-spread {
        flex-direction: column !important;
    }
    .journal-page-left {
        border-right: none;
        border-bottom: 1px solid rgba(130, 95, 60, 0.25);
        padding: 24px 20px;
        min-height: auto;
    }
    .journal-spine-gutter {
        display: none !important;
    }
    .journal-page-right {
        border-left: none;
        padding: 24px 20px;
        min-height: auto;
    }
    .brass-corner {
        width: 24px;
        height: 24px;
    }
}

/* --- Direct Gateway Quick-Access Panel on Login Overlay --- */
.journal-login-gateway-panel {
    margin-top: 10px;
    padding: 6px 12px;
    background: rgba(43, 23, 12, 0.08);
    border: 1px dashed #8c6e54;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Special Elite', monospace;
    box-sizing: border-box;
}

.journal-gateway-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13.5px;
    color: #4a3424;
}

.journal-gateway-label {
    font-weight: 700;
    color: #5c3c24;
    letter-spacing: 0.8px;
}

.journal-gateway-val {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f140d;
    font-size: 13px;
    font-family: monospace;
}

.journal-gateway-btn,
.journal-gateway-save-btn {
    background: linear-gradient(180deg, #6c4222 0%, #4a2b13 100%);
    color: #f7ebd9;
    border: 1px solid #8e623b;
    border-radius: 4px;
    padding: 3px 8px;
    font-family: 'Cinzel', serif;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.journal-gateway-btn:hover,
.journal-gateway-save-btn:hover {
    background: linear-gradient(180deg, #7c4c28 0%, #563318 100%);
    border-color: #ad784a;
}

.journal-gateway-edit-row {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.journal-gateway-edit-row.hidden {
    display: none;
}

.journal-gateway-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #8c6e54;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12.5px;
    color: #1f140d;
    box-sizing: border-box;
}

.journal-gateway-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #5c3c24;
}
