/* Auth Page */

/* Исправление для main страницы auth */
body.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-page {
    display: flex;
    min-height: 100vh;
    background-color: #f8f9fa;
    position: relative;
    overflow: hidden;
    padding-top: 4rem;
}

.auth-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(26, 26, 46, 0.1);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35, #ff8a65);
    z-index: 0;
}

.auth-container>* {
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    position: relative;
}

.auth-header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #ff8a65);
    border-radius: 2px;
}

.auth-header p {
    color: #6c757d;
    font-size: 0.875rem;
}

.alert {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.alert-error {
    background-color: #fef2f2;
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
}

.alert>* {
    position: relative;
    z-index: 1;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a2e;
}

.auth-form input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.3s;
    position: relative;
}

.auth-form input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
    transform: translateY(-1px);
}

.input-hint {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    transition: color 0.3s;
}

.forgot-password {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #ff6b35;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #1a1a2e;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 0.75rem;
    margin-top: 1px;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
    min-width: 20px;
}

.checkbox-label:hover .checkmark {
    border-color: #ff6b35;
    background-color: rgba(255, 107, 53, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.checkbox-label input:checked~.checkmark {
    background-color: #ff6b35;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked~.checkmark:after {
    display: block;
}

.checkbox-label a {
    color: #ff6b35;
    text-decoration: none;
    transition: color 0.3s;
}

.checkbox-label a:hover {
    color: #e55a2b;
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    padding: 0.625rem;
    margin-top: 1rem;
    background-color: #1a1a2e;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-block:hover::before {
    left: 100%;
}

.btn-block:hover {
    background-color: #16213e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.auth-footer a {
    color: #ff6b35;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #e55a2b;
}

/* Стили для страницы статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(26, 26, 46, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35, #ff8a65);
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(26, 26, 46, 0.15);
    border-color: #ff6b35;
}

.stat-card h3 {
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.stat-card p {
    color: #ff6b35;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Адаптивность для статистики */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-card p {
        font-size: 1.5rem;
    }
}

/* Стили для страницы профиля */
.profile-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
}

.profile-section h3 {
    color: #1a1a2e;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
}

.profile-section h3::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #ff6b35, #ff8a65);
    border-radius: 1px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 500;
    color: #6c757d;
    min-width: 80px;
}

.info-row .value {
    color: #1a1a2e;
    font-weight: 500;
}

.status-verified {
    color: #10b981 !important;
}

.status-unverified {
    color: #f59e0b !important;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.organizations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.org-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: all 0.3s;
    position: relative;
}

.org-card:hover {
    border-color: #ff6b35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.1);
}

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

.org-header h4 {
    color: #1a1a2e;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.org-role {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.org-role.owner {
    background: #ff6b35;
    color: white;
}

.org-role.admin {
    background: #6c757d;
    color: white;
}

.org-role.user {
    background: #e9ecef;
    color: #6c757d;
}

.org-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.org-info {
    display: flex;
    gap: 0.5rem;
}

.org-info .label {
    color: #6c757d;
    font-size: 0.875rem;
    min-width: 80px;
}

.org-info .value {
    color: #1a1a2e;
    font-size: 0.875rem;
    font-weight: 500;
}

.org-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.loading,
.empty-state,
.error {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

.error {
    color: #dc3545;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #1a1a2e;
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    color: #aaa;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #1a1a2e;
}

.modal-form {
    padding: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-primary {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

/* Адаптивность для профиля */
@media (max-width: 768px) {
    .auth-container {
        max-width: 95%;
        padding: 1.5rem;
        margin: 0 auto;
    }

    .auth-page {
        padding-top: 3rem;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .btn-secondary {
        width: 100%;
    }

    .org-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .org-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }
}