/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #eab308;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo-text {
    display: flex;
    align-items: baseline;
}

.logo-domain {
    font-size: 1rem;
    opacity: 0.7;
    margin-left: 0.1rem;
}

.header-stats {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 4rem 0 6rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.3;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.highlight {
    background: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 3rem;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    max-width: 700px;
    margin: 0 auto;
}

.drop-zone {
    border: 3px dashed var(--gray-300);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gray-50);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: #dbeafe;
    transform: scale(1.02);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.drop-zone-hint {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Question Section */
.question-section {
    margin-top: 2rem;
}

.question-helper-text {
    color: var(--gray-700);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.question-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.question-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.question-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Popular Questions */
.popular-questions {
    margin-top: 1.5rem;
}

.popular-questions p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.question-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: var(--gray-100);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--primary);
    color: white;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-hint {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    padding: 3rem 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-secondary {
    background: var(--gray-100);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: var(--gray-200);
}

/* Overall Risk */
.overall-risk {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid;
}

.overall-risk.low { border-color: var(--success); }
.overall-risk.medium { border-color: var(--warning); }
.overall-risk.high { border-color: var(--danger); }

/* Risk Card */
.risk-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.risk-card.low { border-color: var(--success); }
.risk-card.medium { border-color: var(--warning); }
.risk-card.high { border-color: var(--danger); }

.risk-level {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.risk-level.low {
    background: #dcfce7;
    color: var(--success);
}

.risk-level.medium {
    background: #fef3c7;
    color: #b45309;
}

.risk-level.high {
    background: #fee2e2;
    color: var(--danger);
}

/* Answer Section */
.answer-section {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.answer-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Recommendations */
.recommendations-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.recommendations-section ul {
    list-style: none;
    padding: 0;
}

.recommendations-section li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.recommendations-section li:before {
    content: "→";
    color: var(--primary);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Disclaimer */
.disclaimer {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* How it Works */
.how-it-works {
    padding: 5rem 0;
    background: white;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: white;
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 1rem;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* File Info */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #d1fae5;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.file-info span {
    color: var(--success);
    font-weight: 600;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0 0.5rem;
}

.btn-remove:hover {
    color: var(--danger);
}

/* Analyze Button */
.btn-analyze {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1.5rem;
}

.btn-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* Highlight Question Input - only border */
.question-input.highlight {
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    animation: pulse-border 2s ease-in-out;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.25);
    }
}

/* НеПодпишу Block */
.ne-podpishu-block {
    background: white;
    border: 3px solid var(--danger);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.ne-podpishu-block .block-title {
    font-size: 1.8rem;
    color: var(--danger);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

/* ВотПочему Block */
.vot-pochemu-block {
    background: white;
    border: 3px solid var(--primary);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.vot-pochemu-block .block-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-align: center;
}

/* Official Refusal Section */
.refusal-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.refusal-warning {
    background: #fff4e6;
    border-left: 4px solid var(--warning);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.refusal-warning p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.refusal-warning p:last-child {
    margin-bottom: 0;
}

.refusal-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

.refusal-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.sender-form {
    margin-bottom: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-input {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.letter-preview {
    margin-bottom: 1.5rem;
}

.letter-preview label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.letter-textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.refusal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-download, .btn-share {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-download {
    background: var(--primary);
    color: white;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-share {
    background: var(--success);
    color: white;
}

.btn-share:hover {
    background: #15803d;
    transform: translateY(-2px);
}

/* Share Section */
.share-section {
    margin-top: 2rem;
    text-align: center;
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .upload-section {
        padding: 1.5rem;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
    }
}
