/* === Pages CSS — Auth, Cabinet, Admin === */

/* Page content */
.page-content {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* Form container */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 15px;
}

.form-title {
    font-size: 28px;
    color: #222;
    margin-bottom: 30px;
    text-align: center;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #292e8b;
    box-shadow: 0 0 0 2px rgba(41, 46, 139, 0.15);
}

.form-group input.input-error,
.form-group textarea.input-error {
    border-color: #fc535b;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Field errors */
.field-error {
    display: none;
    color: #fc535b;
    font-size: 13px;
    margin-top: 4px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

.btn-primary {
    background: #292e8b;
    color: #fff;
}

.btn-primary:hover {
    background: #1a1e6b;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-full {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* Form links */
.form-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-links a {
    color: #292e8b;
    font-size: 14px;
}

.form-links a:hover {
    text-decoration: underline;
}

/* Register success */
.register-success {
    text-align: center;
    padding: 40px 20px;
}

.success-icon-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-success h2 {
    font-size: 24px;
    color: #222;
    margin-bottom: 16px;
}

.register-success p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

/* Password input wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 80px;
}

.password-wrapper .password-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0;
    padding-right: 6px;
}

.password-wrapper .btn-toggle-pass,
.password-wrapper .btn-generate {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: color 0.2s;
    border-radius: 3px;
    height: 100%;
}

.password-wrapper .btn-toggle-pass:hover,
.password-wrapper .btn-generate:hover {
    color: #292e8b;
}

.password-wrapper .btn-toggle-pass svg {
    width: 20px;
    height: 20px;
}

.password-wrapper .btn-generate {
    border-left: 1px solid #ddd;
    border-radius: 0;
    margin-right: 2px;
}

.password-wrapper .btn-generate svg {
    width: 20px;
    height: 20px;
}

.password-wrapper .btn-generate:hover {
    background: rgba(41, 46, 139, 0.08);
}

/* Password requirements */
.password-requirements {
    margin-top: 8px;
    padding: 10px 14px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 13px;
}

.password-requirements p {
    margin-bottom: 6px;
    color: #555;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
}

.password-requirements li {
    padding: 2px 0;
    color: #888;
}

.password-requirements li::before {
    content: '○ ';
    margin-right: 4px;
}

.password-requirements li.req-met {
    color: #16a34a;
}

.password-requirements li.req-met::before {
    content: '● ';
    color: #16a34a;
}

.password-requirements li.req-unmet {
    color: #dc2626;
}

/* Cabinet header */
.cabinet-header {
    background: #292e8b;
    padding: 15px 0;
    color: #fff;
}

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

.cabinet-header h1 {
    font-size: 22px;
    margin: 0;
}

.cabinet-user-info {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 4px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid #e1e1e1;
}

.tab-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #292e8b;
}

.tab-btn.active {
    color: #292e8b;
    border-bottom-color: #292e8b;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Secondary tabs (history) */
.tabs-secondary {
    margin-top: 30px;
    margin-bottom: 15px;
}

.tab-btn-secondary {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn-secondary:hover {
    color: #292e8b;
}

.tab-btn-secondary.active {
    color: #292e8b;
    border-bottom-color: #292e8b;
}

.history-content {
    display: none;
}

.history-content.active {
    display: block;
}

/* Form card */
.form-card {
    background: #fff;
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-card h2 {
    font-size: 20px;
    color: #222;
    margin-bottom: 20px;
}

/* History section */
.history-section {
    margin-top: 40px;
}

.history-section h2 {
    font-size: 22px;
    color: #222;
    margin-bottom: 15px;
}

/* Data tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #292e8b;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e5e5;
    color: #333;
}

.data-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.data-table tbody tr:hover {
    background: #f0f0f0;
}

.empty-row {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px 12px !important;
}

/* Admin section */
.admin-section {
    margin-bottom: 40px;
}

.admin-section h2 {
    font-size: 22px;
    color: #222;
    margin-bottom: 15px;
}

/* Approve page states */
.approve-state {
    text-align: center;
    padding: 20px 0;
}

.approve-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
}

.success-icon {
    background: #16a34a;
}

.error-icon {
    background: #dc2626;
}

/* === Responsive === */
@media (max-width: 767px) {
    .page-content {
        padding: 25px 0;
    }

    .form-container {
        padding: 0 10px;
    }

    .form-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .form-card {
        padding: 20px 15px;
    }

    .cabinet-header-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-btn {
        border-bottom: 1px solid #e1e1e1;
        border-left: 3px solid transparent;
        text-align: left;
    }

    .tab-btn.active {
        border-bottom-color: #e1e1e1;
        border-left-color: #292e8b;
    }

    .tabs-secondary {
        flex-direction: column;
    }

    .tab-btn-secondary {
        border-bottom: 1px solid #e1e1e1;
        text-align: left;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
}
