/**
 * LawGrader.net Styles
 * Modern, responsive design for law exam grading interface
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f5f7fa;
    min-height: 100vh;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 2rem 0;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 20px rgba(0, 0, 0, 0.08);
    padding: 3rem;
    width: 100%;
    max-width: 800px;
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e2e8f0;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #718096;
    font-size: 1.1rem;
}

/* Form Sections */
.form-section {
    border: none;
    margin-bottom: 2rem;
    padding: 0;
}

.form-section legend {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding: 0;
    border: none;
    width: 100%;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: ' *';
    color: #e53e3e;
}

/* Form Controls */
input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4a5568;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
}

input[type="text"].error,
input[type="email"].error,
select.error,
textarea.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

input[type="text"].readonly-field,
input[type="email"].readonly-field {
    background-color: #f7fafc;
    color: #718096;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
    line-height: 1.5;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Field Hints and Errors */
.field-hint {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

.field-error {
    font-size: 0.875rem;
    color: #e53e3e;
    margin-top: 0.25rem;
    display: none;
}

.word-count-low {
    color: #e53e3e;
    font-weight: 500;
}

.word-count-good {
    color: #38a169;
    font-weight: 500;
}

.word-count-high {
    color: #e53e3e;
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #2d3748;
    color: white;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.15);
}

.btn-primary:hover:not(:disabled) {
    background: #1a202c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.2);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4a5568;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #718096;
    font-size: 1.1rem;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #38a169;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.success-message h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.success-message p {
    color: #718096;
    font-size: 1.1rem;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 3rem;
}

.error-icon {
    width: 60px;
    height: 60px;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.error-message h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message p {
    color: #718096;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Form Footer */
.form-footer {
    margin-top: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.info-box {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #cbd5e0;
}

.info-box h4 {
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    color: #718096;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.info-box li::before {
    content: '•';
    color: #4a5568;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    color: #718096;
    margin-bottom: 0.5rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .form-container {
        padding: 2rem 1.5rem;
        margin: 1rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .form-header h2 {
        font-size: 1.75rem;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .form-footer {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-box {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 1.5rem 1rem;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-header p {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .form-container {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .btn {
        display: none;
    }
    
    .footer {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        color: #fff;
    }
    
    .btn-secondary {
        background: #fff;
        color: #000;
        border-color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
    }
}
