* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Синяя цветовая палитра */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #60a5fa;
    --primary-dark: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    
    /* Нежная синяя цветовая палитра */
    --bg-color: #f0f7ff;
    --bg-secondary: #e0f2fe;
    --card-bg: #ffffff;
    --text-color: #1e3a8a;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    
    /* Мягкие синие акценты */
    --accent-blue-light: #dbeafe;
    --accent-blue: #bfdbfe;
    --accent-green: #d1fae5;
    --accent-yellow: #fef3c7;
    --accent-purple: #e9d5ff;
    
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(59, 130, 246, 0.05);
    --shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.08), 0 2px 4px -1px rgba(59, 130, 246, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -2px rgba(59, 130, 246, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(59, 130, 246, 0.12), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: '📁';
    font-size: 1.75rem;
}

.logo:hover {
    color: var(--primary-hover);
    transform: translateY(-1px);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-size: 0.9375rem;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.username {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.logout-form {
    display: inline;
}

.btn-logout {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-logout:hover {
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

/* Main content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--primary-light);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-secondary:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #ef4444;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 2.5rem; /* Минимальная высота для одинакового размера */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn.copied {
    background: var(--success-color);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Upload page */
.upload-container {
    max-width: 680px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.upload-container h1 {
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.upload-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-of-type {
    margin-bottom: 1.75rem; /* Отступ перед кнопкой */
}

.auth-form .form-group:last-of-type {
    margin-bottom: 1.75rem; /* Отступ перед кнопкой в формах авторизации */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.file-input {
    padding: 1.5rem;
    cursor: pointer;
    border: 2px dashed var(--border-color) !important;
    background: var(--bg-secondary);
    transition: all 0.2s;
    text-align: center;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    position: relative;
}

.file-input::file-selector-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

.file-input::file-selector-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.file-input:hover {
    border-color: var(--primary-color) !important;
    background: var(--accent-blue-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Upload Progress */
.upload-progress {
    display: none;
    margin-top: 1.5rem;
    margin-bottom: 1.75rem; /* Отступ перед кнопкой */
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
}

.upload-progress.active {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-filename {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
}

.progress-percentage {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.progress-status {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

.info-box {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.info-box h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
}

.info-box ul {
    list-style: none;
    color: var(--text-secondary);
}

.info-box li {
    margin-bottom: 0.75rem;
    padding-left: 1.75rem;
    position: relative;
    font-size: 0.9375rem;
}

.info-box li:last-child {
    margin-bottom: 0;
}

.info-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    background: var(--accent-green);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Success page */
.success-container {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    animation: scaleIn 0.4s ease-out;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.success-container h1 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 800;
}

.file-info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.file-info-card h3 {
    margin-bottom: 1.25rem;
    color: var(--text-color);
    word-break: break-all;
    font-size: 1.125rem;
    font-weight: 700;
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.file-header h3 {
    margin-bottom: 0;
    flex: 1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row .label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.token,
.token-small {
    background: var(--bg-secondary);
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    font-weight: 600;
    color: var(--primary-color);
}

.token-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.link-box {
    margin-bottom: 1.5rem;
}

.link-box label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-color);
    font-size: 0.875rem;
}

.link-input-group {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.link-input-group .btn {
    flex-shrink: 0;
}

.link-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: 'Courier New', monospace;
    background: white;
    color: var(--text-color);
}

.actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem; /* Отступ сверху */
}

/* Registration promo box */
.registration-promo {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.registration-promo h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.registration-promo p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.registration-promo ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
    text-align: left;
    display: inline-block;
    color: var(--text-secondary);
}

.registration-promo li {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.promo-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Download page */
.download-container {
    max-width: 680px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.download-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
}

.download-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.error-message {
    background: #fef2f2;
    border: 1.5px solid var(--danger-color);
    padding: 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    margin-bottom: 1.5rem;
}

.error-message h2 {
    color: var(--danger-color);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.error-message p {
    color: var(--text-secondary);
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: all 0.2s;
    display: inline-block;
    font-size: 0.9375rem;
}

.back-link a:hover {
    background: var(--accent-blue-light);
}

/* Dashboard */
.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.dashboard-container h1 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
}

.dashboard-container .subtitle {
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.files-list {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.file-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.file-card.expired {
    opacity: 0.65;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.badge-active {
    background: var(--accent-green);
    color: #065f46;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
}

.badge-limit {
    background: var(--accent-yellow);
    color: #92400e;
}

.file-details {
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    gap: 1rem;
}

.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.file-actions .btn,
.file-actions form {
    display: inline-flex;
    align-items: center;
}

.file-actions .btn-danger {
    min-height: 2.5rem; /* Та же высота что и у других кнопок */
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Error page */
.error-container {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 1.5rem;
    animation: fadeInUp 0.5s ease-out;
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--danger-color) 0%, #ef4444 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    animation: scaleIn 0.4s ease-out;
    box-shadow: 0 8px 20px rgba(248, 113, 113, 0.3);
}

.error-container h1 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.75rem;
    font-weight: 800;
}

.error-container .error-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

/* Auth pages */
.auth-container {
    max-width: 480px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
}

.auth-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.auth-links {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Settings page */
.settings-container {
    max-width: 720px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.settings-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 800;
}

.settings-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 700;
}

.form-help {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Footer */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
}

footer p {
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .user-info {
        width: 100%;
        justify-content: center;
    }
    
    .upload-container h1,
    .success-container h1,
    .download-container h1,
    .dashboard-container h1,
    .auth-container h1,
    .settings-container h1 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .link-input-group {
        flex-direction: column;
    }
    
    .actions,
    .file-actions,
    .form-actions {
        flex-direction: column;
    }
    
    .file-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-form,
    .download-form,
    .file-info-card,
    .auth-form,
    .settings-form {
        padding: 1.5rem;
    }
    
    .info-box {
        padding: 1.25rem;
    }
    
    main {
        padding: 2rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
}