/* === Accessibility === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: #6c63ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* === Auth Pages === */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: #6c63ff;
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.auth-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: #a0a0b0;
    margin-bottom: 1.5rem;
}

/* === Forms === */
.auth-form {
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #b0b0c0;
    margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background-color: #16213e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    color: #e0e0e0;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #6c63ff;
}

.form-group input.input-error {
    border-color: #ff4757;
}

.form-group input::placeholder {
    color: #555570;
}

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

.password-wrapper input {
    padding-right: 5rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c63ff;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Error Messages === */
.error-message {
    display: block;
    font-size: 0.8rem;
    color: #ff4757;
    margin-top: 0.25rem;
}

/* === Buttons === */
.btn-primary {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: #6c63ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 48px;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background-color: #5a52d5;
}

.btn-primary:active {
    background-color: #4840b0;
}

/* === Links === */
.auth-link {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: #a0a0b0;
}

/* === Checkbox & Inline Groups === */
.form-group-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #b0b0c0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6c63ff;
}

.forgot-link {
    color: #6c63ff;
    font-size: 0.85rem;
}

/* === Alerts === */
.alert {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: rgba(255, 71, 87, 0.15);
    border: 1px solid #ff4757;
    color: #ff6b7a;
}

.alert-success {
    background-color: rgba(46, 213, 115, 0.15);
    border: 1px solid #2ed573;
    color: #7bed9f;
}

.alert-warning {
    background-color: rgba(255, 165, 2, 0.15);
    border: 1px solid #ffa502;
    color: #ffc048;
}

/* === Home Page === */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

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

.header h1 {
    font-size: 1.25rem;
    color: #6c63ff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.username {
    font-size: 0.875rem;
    color: #b0b0c0;
}

.logout-form {
    display: inline;
}

.btn-logout {
    background: none;
    border: 1px solid #444;
    color: #a0a0b0;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    min-height: 36px;
}

.btn-logout:hover {
    border-color: #ff4757;
    color: #ff4757;
}

.main-content {
    padding: 1.5rem 0;
}

/* === Общие модалки === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.visible { display: flex; }

.modal-content {
    background: #1a1a2e;
    border: 1px solid #33334d;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
}

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

.modal-header h2 {
    font-size: 1rem;
    color: #6c63ff;
}

.modal-close {
    background: none;
    border: none;
    color: #8888aa;
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-body {
    padding: 1rem;
}

.modal-body label {
    display: block;
    font-size: 0.85rem;
    color: #8888aa;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}
