@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

:root {
    --auth-primary: #c8860a;
    --auth-primary-dark: #a56a08;
    --auth-secondary: #1a1a2e;
    --auth-bg-start: #1a1a2e;
    --auth-bg-end: #2d2d4a;
    --auth-card-radius: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(145deg, var(--auth-bg-start) 0%, var(--auth-bg-end) 55%, #3d3d5c 100%);
    color: var(--auth-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: #fff;
    border-radius: var(--auth-card-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.auth-card-body {
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 8px 20px rgba(200, 134, 10, 0.35);
}

.auth-brand h1 {
    font-size: clamp(1.1rem, 3.5vw, 1.35rem);
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--auth-secondary);
}

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

.auth-form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.auth-form-control {
    min-height: 48px;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    width: 100%;
}

.auth-form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 0.2rem rgba(200, 134, 10, 0.2);
    outline: none;
}

.auth-input-group {
    display: flex;
    gap: 0;
}

.auth-input-group .auth-form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}

.auth-toggle-pwd {
    min-height: 48px;
    min-width: 48px;
    border: 1px solid #dee2e6;
    border-left: none;
    border-radius: 0 10px 10px 0;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
}

.auth-btn-primary {
    min-height: 48px;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(200, 134, 10, 0.35);
}

.auth-btn-link {
    background: none;
    border: none;
    color: var(--auth-primary-dark);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0;
    cursor: pointer;
}

.auth-btn-link:hover {
    text-decoration: underline;
}

.auth-remember {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.auth-remember input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--auth-primary);
    flex-shrink: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #6c757d;
}

.auth-alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.auth-alert-danger {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.auth-alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.auth-alert-info {
    background: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

.auth-alert-warning {
    background: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--auth-primary-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.auth-back:hover {
    text-decoration: underline;
}

.auth-hint {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.35rem;
}

@media (max-width: 380px) {
    .auth-links {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}
