/* Design system lifted from HSE-OCR (main branch, same company, same look) */

:root {
    --griehser-red: #C8102E;
    --griehser-dark-red: #A00D25;
    --griehser-black: #1a1a1a;
    /* Login page only -- rest of the app keeps the red brand color */
    --login-blue: #0D6EFD;
    --login-dark-blue: #0A58CA;
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding-bottom: 3rem;
}

/* Navbar */
.navbar-custom {
    background: white;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    z-index: 1000;
}

.navbar-brand img {
    height: 45px;
}

.btn-logout {
    background: var(--griehser-red);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
}

.btn-logout:hover {
    background: var(--griehser-dark-red);
}

/* Cards */
.glass-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

/* Login page */
.login-container {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
    padding-top: 5rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 25px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.logo-container {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-container img {
    height: 60px;
    margin-bottom: 1rem;
}

.login-title {
    text-align: center;
    color: var(--griehser-black);
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.form-label {
    font-weight: 600;
    color: var(--griehser-black);
    margin-bottom: 0.5rem;
}

.form-control {
    padding: 0.9rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--login-blue);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    outline: none;
}

.btn-login {
    background: linear-gradient(135deg, var(--login-blue), var(--login-dark-blue));
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--griehser-red);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

/* Upload area */
.upload-area {
    border: 3px dashed #dee2e6;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--griehser-red);
    background: rgba(200, 16, 46, 0.05);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--griehser-red);
    margin-bottom: 1rem;
}

.file-selected-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.file-selected-list li {
    background: #d4edda;
    border: 2px solid #28a745;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-selected-list .bi-x-circle-fill {
    margin-left: auto;
    cursor: pointer;
    color: #6c757d;
}

.btn-upload {
    background: linear-gradient(135deg, var(--griehser-red), var(--griehser-dark-red));
    border: none;
    color: white;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
    display: none;
}
.btn-upload.show { display: inline-block; }

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
}

/* Error messages */
.error-message {
    background: #fee;
    border: 2px solid var(--griehser-red);
    color: var(--griehser-dark-red);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    display: none;
    align-items: center;
    gap: 0.75rem;
}
.error-message.show { display: flex; }

/* Toast variant of error-message, fixed to viewport corner (upload errors) */
.error-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    max-width: 320px;
}

/* Utility classes replacing inline style="" attributes (CSP style-src-attr has no
   'unsafe-inline' and never should - these exist so nothing needs one). */
.heading-black { color: var(--griehser-black); }
.heading-bold { font-weight: 700; }
.glass-card-title { font-weight: 600; margin-bottom: 1.5rem; }
.hidden-file-input { display: none; }

/* Results page: editable extracted fields */
.field-group {
    margin-bottom: 1.25rem;
}

.field-group label {
    font-weight: 600;
    color: var(--griehser-black);
    margin-bottom: 0.35rem;
}

.mangel-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fafbfc;
    position: relative;
}

.mangel-card .btn-remove-mangel {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.btn-add-mangel {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    background: transparent;
    color: var(--griehser-black);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    width: 100%;
}

.btn-add-mangel:hover {
    border-color: var(--griehser-red);
    color: var(--griehser-red);
}

/* Live .txt preview, monospace like HSE-OCR's raw OCR text view */
.txt-preview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0;
}

.btn-download {
    background: linear-gradient(135deg, var(--griehser-red), var(--griehser-dark-red));
    border: none;
    color: white;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    box-shadow: 0 4px 15px rgba(200, 16, 46, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
    color: white;
}
