/* style.css - Mansy OCR (LTR layout, 2 columns, soft colors)
   Colors: white, light gray, dark blue
*/

/* Basic reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    direction: ltr;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
    background: #f3f5f8;
    color: #1f2933;
}

/* ================= Login page ================= */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    padding: 26px 24px 24px;
}

.auth-header {
    margin-bottom: 22px;
}

.auth-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.auth-subtitle {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #4b5563;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 11px 12px;
    border-radius: 9px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.btn-block {
    width: 100%;
}

/* ================= App shell ================= */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: #0f172a;
    color: #e5e7eb;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.45);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-size: 18px;
    font-weight: 700;
}

.brand-title {
    font-weight: 600;
    font-size: 16px;
}

.brand-subtitle {
    font-size: 12px;
    color: #9ca3af;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: rgba(31, 41, 55, 0.7);
    border-color: #4b5563;
    color: #ffffff;
}

.nav-divider {
    color: #6b7280;
}

/* Main layout */

.app-main {
    flex: 1;
    padding: 24px 18px 32px;
    max-width: 90%;
    margin: 0 auto;
}

/* Two-column grid for main content */

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
    gap: 20px;
    align-items: flex-start;
}

.layout-left,
.layout-right {
    min-width: 0;
}

@media (max-width: 960px) {
    .layout-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Cards */

.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
    padding: 20px 20px 22px;
    margin-bottom: 22px;
}

.card-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.card-desc {
    margin: 0 0 18px;
    font-size: 13px;
    color: #6b7280;
}

.card-desc.muted {
    color: #9ca3af;
}

/* Alerts */

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

/* Preview block */

.preview-block {
    margin-bottom: 16px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 12px 10px;
    border: 1px solid #e5e7eb;
}

.preview-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.preview-frame {
    width: 100%;
    max-height: 320px;
    border-radius: 12px;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-frame img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.preview-filename {
    margin-top: 6px;
    font-size: 12px;
    color: #4b5563;
    word-break: break-all;
}

.preview-placeholder {
    padding: 18px 12px;
    border-radius: 10px;
    border: 1px dashed #d1d5db;
    background: #f9fafb;
    font-size: 12px;
    color: #6b7280;
}

/* OCR form */

.ocr-form .form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .ocr-form .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.form-block {
    background: #f9fafb;
    border-radius: 12px;
    padding: 14px 14px 12px;
    border: 1px solid #e5e7eb;
}

.form-label {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
}

/* File input */

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px dashed #cbd5f5;
    padding: 10px 12px;
    cursor: pointer;
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-button {
    background: #1d4ed8;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.file-text {
    font-size: 12px;
    color: #6b7280;
}

/* Small text hint */

.hint {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

/* Radio buttons */

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.radio-item input[type="radio"] {
    accent-color: #1d4ed8;
}

/* Buttons */

.actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
}

.actions-right {
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-large {
    padding: 12px 20px;
    font-size: 15px;
}

.btn-primary {
    background: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: #1e40af;
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(30, 64, 175, 0.35);
}

/* Result text area */

.card-result {
    margin-bottom: 22px;
}

.result-text {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: 15px;
    line-height: 1.5;
    font-family: "Cascadia Mono", "Consolas", "SF Mono", Menlo, Monaco, monospace;
    background: #f9fafb;
    resize: vertical;
    min-height: 320px;
    outline: none;
}

/* Footer */

.app-footer {
    padding: 10px 20px 16px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

/* Cleanup page (dark style) */

.cleanup-body {
    background: #0b1120;
    color: #e5e7eb;
}

.cleanup-shell .card-cleanup {
    max-width: 520px;
    margin: 40px auto;
    background: #020617;
    border-radius: 16px;
    border: 1px solid #1e293b;
}

.cleanup-summary p {
    margin: 6px 0;
    font-size: 13px;
}

.cleanup-errors {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 12px;
    color: #f97373;
}

/* General */

strong {
    font-weight: 700;
}
