/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --success-color: #16a34a;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Footer */
.app-footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

.btn-small {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Landing Page */
.landing-container {
    max-width: 1200px;
    margin: 0 auto;
}

.landing-hero {
    text-align: center;
    padding: 3rem 0;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-item {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.cta-section {
    margin-top: 2rem;
}

.cta-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.landing-info {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 3rem;
    box-shadow: var(--shadow);
}

.landing-info h2 {
    margin-bottom: 1.5rem;
}

.doc-types-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.doc-types-list li {
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.9375rem;
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-box {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    margin-bottom: 0.5rem;
}

.login-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-yandex {
    background: #fc0;
    color: #000;
    width: 100%;
    justify-content: center;
    padding: 0.875rem;
    font-size: 1rem;
}

.btn-yandex:hover {
    background: #e6b800;
}

.login-note {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-note p {
    margin: 0.25rem 0;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--surface-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid;
}

.toast.success {
    border-color: var(--success-color);
}

.toast.error {
    border-color: var(--danger-color);
}

.toast.warning {
    border-color: var(--warning-color);
}

.toast.info {
    border-color: var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-main {
        padding: 1rem;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
    }
}
