* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: sans-serif;
    background: #f7f7f7;
    color: #222;
    min-height: 100vh;
}

/* ── Header ── */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    z-index: 100;
}
header .logo { font-size: 1rem; font-weight: 600; color: #222; text-decoration: none; }
header .auth-buttons { display: flex; gap: 10px; }

.btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity .15s;
}
.btn:hover { opacity: .8; }
.btn-outline { background: #fff; border: 1px solid #222; color: #222; }
.btn-primary { background: #222; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }

/* ── Main ── */
main {
    padding-top: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Drop zone ── */
#drop-zone {
    margin-top: 60px;
    width: 100%;
    max-width: 520px;
    border: 2px dashed #bbb;
    border-radius: 14px;
    padding: 52px 32px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s, background .2s;
}
#drop-zone:hover, #drop-zone.dragover {
    border-color: #222;
    background: #f0f0f0;
}
#drop-zone svg { display: block; margin: 0 auto 18px; color: #aaa; }
#drop-zone p { font-size: 1rem; color: #555; line-height: 1.6; }
#drop-zone span { font-weight: 600; color: #222; }

/* ── PDF Controls ── */
#pdf-controls {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 10px 16px;
    flex-wrap: wrap;
    justify-content: center;
}
#pdf-controls.visible { display: flex; }
#pdf-controls .file-name {
    font-size: .82rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
#pdf-controls .page-info { font-size: .82rem; color: #555; white-space: nowrap; }
#pdf-controls .nav-btn {
    padding: 6px 12px;
    font-size: .82rem;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: background .15s;
}
#pdf-controls .nav-btn:hover:not(:disabled) { background: #f0f0f0; }
#pdf-controls .nav-btn:disabled { opacity: .35; cursor: default; }
#pdf-controls .separator { width: 1px; height: 24px; background: #e0e0e0; }
#btn-close-pdf {
    background: none; border: none;
    font-size: 1.2rem; cursor: pointer; color: #888;
    line-height: 1;
}

/* ── PDF Viewer ── */
#pdf-viewer-wrap {
    display: none;
    margin-top: 20px;
    width: 100%;
    max-width: 860px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    margin-bottom: 40px;
    text-align: center;
}
#pdf-viewer-wrap.visible { display: block; }

#pdf-page-container {
    position: relative;
    display: inline-block;
}

#pdf-canvas { display: block; }

#pdf-loading {
    padding: 60px;
    text-align: center;
    color: #888;
    font-size: .9rem;
}

/* ── Text Layer (editable spans over canvas) ── */
#text-layer {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    display: none;
    overflow: hidden;
}

/* ── Modal ── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    justify-content: center;
    align-items: center;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    position: relative;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 22px; }
.modal label { display: block; font-size: .8rem; color: #555; margin-bottom: 4px; }
.modal input[type="email"],
.modal input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: .9rem;
    margin-bottom: 16px;
    outline: none;
    transition: border .15s;
}
.modal input:focus { border-color: #222; }
.modal .btn-primary { width: 100%; padding: 11px; font-size: .95rem; }
.modal .close-btn {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    font-size: 1.3rem; cursor: pointer; color: #888;
}
.modal .msg { font-size: .82rem; margin-top: 14px; text-align: center; min-height: 18px; }
.modal .msg.error { color: #c0392b; }
.modal .msg.success { color: #27ae60; }
.modal .switch { text-align: center; margin-top: 16px; font-size: .82rem; color: #555; }
.modal .switch a { color: #222; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ── Dashboard ── */
.dashboard-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    font-size: 2rem;
}
