:root {
    --primary: #4a90e2;
    --success: #2ecc71;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #f4f6f8;
    --white: #ffffff;
    --gray: #95a5a6;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark);
}

/* Header */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.user-nav, .auth-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-info {
    text-align: right;
    margin-right: 10px;
    font-size: 0.9rem;
    color: var(--dark);
}

.user-info b {
    color: var(--primary);
}

.user-info small {
    color: var(--gray);
}

.coin-badge {
    background: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    border: 1px solid #ffeeba;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    text-align: center;
    font-size: 0.95rem;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--dark);
}

.btn-outline:hover {
    border-color: var(--dark);
    background: #eee;
}

.btn-block {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 5px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.error {
    background: #fdecea;
    border-color: var(--danger);
    color: #c0392b;
}

.alert.success {
    background: #eafaf1;
    border-color: var(--success);
    color: #27ae60;
}

.alert i {
    font-size: 1.2rem;
}

/* Filters */
.filters {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.filters h3 {
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.filters h3 i {
    color: var(--primary);
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-group label i {
    color: var(--primary);
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    color: var(--dark);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 0.5rem;
}

.filter-buttons .btn {
    flex: 1;
}

.results-info {
    margin-bottom: 1rem;
    color: var(--gray);
}

.results-info strong {
    color: var(--primary);
}

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.card-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
    word-break: break-word;
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.card-body {
    padding: 1rem;
    flex: 1;
}

.card-body p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body i {
    color: var(--primary);
    width: 18px;
}

.stats {
    display: flex;
    gap: 15px;
    margin: 0.5rem 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

.desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.5rem !important;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    background: #f8f9fa;
}

.price {
    font-weight: bold;
    color: var(--dark);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.price i {
    color: #f39c12;
}

.card-actions {
    display: flex;
    gap: 5px;
}

/* Auth Pages (Login/Register) */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.reg-container {
    max-width: 500px;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.auth-header h2 {
    color: var(--dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--gray);
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group label i {
    color: var(--primary);
    width: 20px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    color: var(--dark);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Upload Page */
.upload-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.upload-form h2 {
    color: var(--dark);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-form h2 i {
    color: var(--primary);
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-name {
    color: var(--gray);
    font-size: 0.9rem;
    background: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.hint {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hint i {
    color: var(--primary);
}

/* Profile Page */
.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    border: 3px solid white;
}

.profile-info h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: white;
    margin: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.9;
}

.profile-info i {
    color: white;
    width: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 0.5rem;
    border-radius: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    border-radius: 30px;
    font-weight: 600;
    color: var(--gray);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.tab i {
    margin-right: 5px;
    color: var(--gray);
}

.tab.active {
    background: var(--primary);
    color: white;
}

.tab.active i {
    color: white;
}

/* Transactions */
.transaction-list {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.transaction-item {
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #f8f9fa;
}

.transaction-item.expense .transaction-amount {
    color: var(--danger);
}

.transaction-item.income .transaction-amount {
    color: var(--success);
}

.transaction-info strong {
    color: var(--dark);
    display: block;
    margin-bottom: 0.25rem;
}

.transaction-info span {
    color: var(--gray);
    font-size: 0.9rem;
}

.transaction-amount {
    font-weight: bold;
    font-size: 1.2rem;
}

.transaction-date {
    color: var(--gray);
    font-size: 0.9rem;
}

/* No Data */
.no-data {
    text-align: center;
    color: var(--gray);
    grid-column: 1 / -1;
    padding: 3rem;
    background: var(--white);
    border-radius: 10px;
    font-size: 1.1rem;
    border: 1px solid #eee;
}

.no-data i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.no-data p {
    margin: 0.5rem 0;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Landing Page */
.landing .hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.landing .hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.landing .hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.landing .hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s both;
}

.landing .hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease 0.4s both;
}

.landing .features {
    padding: 5rem 2rem;
    background: white;
}

.landing .features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
}

.landing .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.landing .feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    background: #f8f9fa;
    transition: transform 0.3s ease;
}

.landing .feature-card:hover {
    transform: translateY(-10px);
}

.landing .feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.landing .how-it-works {
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.landing .how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
}

.landing .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.landing .step {
    text-align: center;
    position: relative;
}

.landing .step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.landing .stats {
    padding: 4rem 2rem;
    background: white;
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.landing .stat-item {
    text-align: center;
}

.landing .stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing .stat-label {
    color: var(--gray);
    font-size: 1.1rem;
}

.landing .cta {
    padding: 5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.landing .cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.landing .cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Custom Inputs for Registration */
.custom-input {
    margin: 1rem 0;
    padding: 1.5rem;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    animation: slideDown 0.3s ease;
}

.custom-input::before {
    content: '✏️';
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.custom-input label {
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.custom-input input {
    border-color: var(--primary);
}

.institution-type {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.institution-type label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--dark);
}

.institution-type input[type="radio"] {
    width: auto;
    accent-color: var(--primary);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Material Page */
.material-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 10px 10px 0 0;
    color: white;
}

.material-title-section h1 {
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.material-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.material-meta .badge {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.author-section {
    padding: 2rem;
    background: white;
    border-bottom: 1px solid #eee;
}

.author-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.author-details h4 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.author-details p {
    color: var(--gray);
    margin: 0.2rem 0;
}

.material-description,
.material-details,
.comments-section {
    padding: 2rem;
    background: white;
    border-bottom: 1px solid #eee;
}

.description-content {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.8;
    color: var(--dark);
    white-space: pre-wrap;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.3rem;
    display: block;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1rem;
    resize: vertical;
    min-height: 100px;
}

.comment-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-date {
    color: var(--gray);
    font-size: 0.85rem;
}

/* --- УЛУЧШЕННАЯ АДАПТАЦИЯ --- */

/* Планшет и небольшие ноутбуки */
@media (max-width: 992px) {
    .filter-row {
        grid-template-columns: 1fr; /* Фильтры в одну колонку */
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    /* Шапка */
    header {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .user-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .user-info {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    /* Сетка карточек */
    .grid {
        grid-template-columns: 1fr; /* Одна колонка на всю ширину */
        gap: 15px;
    }

    /* Карточки */
    .card {
        margin-bottom: 0; /* Убираем лишние отступы, так как gap есть у grid */
    }

    .card-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch; /* Кнопки на всю ширину */
    }

    .card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .card-actions .btn {
        flex: 1; /* Кнопки делят место поровну */
    }

    /* Фильтры */
    .filters {
        padding: 1rem;
    }

    .filter-buttons {
        flex-direction: column;
    }

    .filter-buttons .btn {
        width: 100%;
    }

    /* Профиль */
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .profile-info p {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr; /* 2 колонки статистики вместо 4 */
    }

    /* Транзакции */
    .transaction-item {
        grid-template-columns: 1fr; /* Вертикальный список */
        text-align: left;
        gap: 0.5rem;
        padding: 1rem;
        border-left: 4px solid transparent;
    }
    
    /* Цветовая индикация для мобильных транзакций */
    .transaction-item.expense { border-left-color: var(--danger); background: #fff5f5; }
    .transaction-item.income { border-left-color: var(--success); background: #f0fff4; }

    .transaction-amount {
        text-align: right;
        font-size: 1.1rem;
    }

    .transaction-date {
        font-size: 0.8rem;
        opacity: 0.7;
    }

    /* Автор материала */
    .author-info {
        flex-direction: column;
        text-align: center;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px; /* Чуть меньше базовый шрифт */
    }

    /* Кнопки на весь экран для удобства */
    .btn {
        padding: 12px 20px; /* Увеличиваем зону клика */
        width: 100%; /* Все кнопки на всю ширину */
        display: block;
        text-align: center;
    }
    
    /* Исключение для маленьких кнопок внутри карточек, если они в ряду */
    .card-actions .btn {
        width: auto;
        display: inline-block;
        padding: 8px 12px;
    }

    /* Лендинг */
    .landing .hero h1 {
        font-size: 2.5rem; /* Уменьшаем огромный заголовок */
    }
    
    .landing .hero p {
        font-size: 1.1rem;
    }

    .landing .hero-buttons {
        flex-direction: column;
    }

    .landing .features h2,
    .landing .how-it-works h2 {
        font-size: 1.8rem;
    }

    .landing .stat-number {
        font-size: 2.2rem;
    }

    /* Профиль */
    .stats-grid {
        grid-template-columns: 1fr; /* Статистика в одну колонку */
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    .profile-info h2 {
        font-size: 1.5rem;
    }

    /* Форма авторизации */
    .auth-container {
        padding: 1.5rem;
        width: 90%; /* Отступы по краям экрана */
    }

    /* Инпуты */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px; /* Чуть меньше паддинг, чтобы влезало */
    }
    
    /* Убираем лишние отступы у контейнеров */
    main {
        padding: 0 0.5rem;
        margin-top: 1rem;
    }
    
    /* Адаптация карточки материала */
    .material-header {
        padding: 1rem;
    }
    
    .material-title-section h1 {
        font-size: 1.4rem;
    }
    
    .author-section, 
    .material-description, 
    .material-details {
        padding: 1rem;
    }
}