/* ============================================
   style.css - Стили для читательской части
   МАУ МБС г. Твери - Продление книг
   ============================================ */

/* ===== CSS Variables ===== */
:root {
    --primary: #2c6e49;
    --primary-dark: #1a4a2e;
    --primary-light: #4c9a6e;
    --primary-bg: #e8f5ee;
    --secondary: #f4a261;
    --danger: #e76f51;
    --success: #2a9d8f;
    --info: #4a90d9;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #8c959f;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 6px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Typography ===== */
h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

p {
    font-size: 16px;
    line-height: 1.7;
}

/* ===== Header ===== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo:hover {
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
}

.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
    text-decoration: none;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 40px 0 30px;
}

.hero h1 {
    font-size: 34px;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.hero p {
    font-size: 18px;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Info Grid ===== */
.info-block {
    margin-bottom: 40px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-item .icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.info-item h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-item p {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
}

/* ===== Form Section ===== */
.form-section {
    margin-bottom: 40px;
}

.form-card {
    background: white;
    padding: 32px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 580px;
    margin: 0 auto;
    border: 1px solid var(--gray-100);
}

.form-card h2 {
    font-size: 22px;
    text-align: center;
    margin-bottom: 24px;
    color: var(--gray-900);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
    background: white;
    color: var(--gray-900);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.12);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--danger);
}

.form-group input.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.15);
}

.form-group small {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    min-height: 48px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 110, 73, 0.35);
    text-decoration: none;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #21867a;
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    text-decoration: none;
}

.btn .btn-icon {
    font-size: 18px;
}

/* ===== Messages ===== */
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message.hidden {
    display: none;
}

/* ===== Status Section ===== */
.status-section {
    margin-bottom: 40px;
    text-align: center;
}

.status-section h2 {
    font-size: 22px;
    margin-bottom: 16px;
}

.status-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.status-form .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.status-form .form-group input {
    padding: 10px 14px;
}

.status-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    text-align: left;
}

.status-result.hidden {
    display: none;
}

/* ===== Message Box (result page) ===== */
.message-box {
    max-width: 560px;
    margin: 40px auto;
    padding: 40px 36px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-xl);
    background: white;
}

.message-box.success {
    border-top: 4px solid var(--success);
}

.message-box.error {
    border-top: 4px solid var(--danger);
}

.message-box h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.message-box .highlight {
    font-size: 18px;
    margin: 16px 0;
    padding: 12px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
}

.message-box .highlight strong {
    color: var(--primary);
    font-size: 20px;
}

.message-box ul {
    list-style: none;
    text-align: left;
    margin: 12px 0;
}

.message-box ul li {
    padding: 4px 0;
    color: var(--danger);
}

.message-box ul li::before {
    content: "• ";
    color: var(--danger);
}

.message-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.message-box a:hover {
    text-decoration: underline;
}

/* ===== Status Result Card ===== */
.status-result-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 28px 32px;
    margin-top: 24px;
    border: 1px solid var(--gray-100);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 16px;
}

.status-header h2 {
    font-size: 20px;
    margin: 0;
}

.status-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-details {
    display: grid;
    gap: 6px;
}

.detail-row {
    display: flex;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-50);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    color: var(--gray-600);
    min-width: 140px;
    font-weight: 500;
}

.detail-row .value {
    color: var(--gray-900);
}

/* ===== Footer ===== */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 20px 0;
    margin-top: auto;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer p {
    color: var(--gray-600);
    font-size: 14px;
    margin: 0;
}

.admin-link a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 13px;
}

.admin-link a:hover {
    color: var(--gray-600);
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablets */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 26px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .form-card {
        padding: 24px 20px;
    }
    
    .form-card h2 {
        font-size: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .status-form {
        flex-direction: column;
    }
    
    .status-form .form-group {
        min-width: auto;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    .status-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 2px;
    }
    
    .detail-row .label {
        min-width: auto;
    }
    
    .message-box {
        padding: 28px 20px;
        margin: 20px 16px;
    }
    
    .message-box h2 {
        font-size: 22px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 22px;
    }
    
    .form-card {
        padding: 20px 16px;
    }
    
    .form-card h2 {
        font-size: 18px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .status-form .btn {
        width: 100%;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .status-result-card {
        padding: 16px;
    }
}

/* Small phones */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 20px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .nav a {
        font-size: 13px;
    }
}