/* web/static/style.css */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
    font-weight: 500;
}

.logout-btn {
    background-color: var(--danger-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Container */
.container {
    width: 100%;
    max-width: none;
    margin: 1rem auto;
    padding: 0 1.5rem;
    padding-bottom: 4rem;
    box-sizing: border-box;
}

/* Card Style */
.auth-box,
.search-card,
.table-responsive {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.auth-box {
    max-width: 480px;
    padding: 2.5rem;
    margin: 5vh auto 0 auto;
}

.search-card {
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

/* Search Group */
.search-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.search-input-group input {
    flex: 1;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table th {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    vertical-align: top;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Control wrapping for lotsTable specifically */
#lotsTable th,
#lotsTable td {
    white-space: nowrap;
}

#lotsTable th:nth-child(2),
#lotsTable td:nth-child(2) {
    white-space: normal;
    min-width: 250px;
    max-width: 400px;
}

/* Status Text */
.lots-count {
    color: var(--primary-color);
    font-weight: 800;
}

.sum-highlight {
    color: var(--text-main);
    font-weight: 700;
}

.required-badge {
    color: var(--success-color);
    font-weight: 700;
}

/* Progress */
#auth-progress {
    margin-top: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.status-text {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .search-input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }
}