/* Shared styles for the sign-in pages: login, signup, email verification and
   the forgot-password flow. Loaded through includes/auth_assets.html. */

.auth-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #1e2a4a 0%, #2c3e50 45%, #4b2c7a 100%);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
}

.auth-wrap.auth-wrap-wide {
    max-width: 480px;
}

.auth-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(10, 15, 40, 0.35);
    overflow: hidden;
}

.auth-card-body {
    padding: 2.5rem 2.25rem 2rem;
}

.auth-logo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 1.1rem;
    border: 3px solid #ffffff;
    box-shadow: 0 6px 18px rgba(44, 62, 80, 0.25);
}

/* Round icon used instead of the logo on status pages (email sent, done). */
.auth-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.1rem;
    font-size: 1.75rem;
    color: #6d4bb3;
    background: #f1ecfa;
}

.auth-badge.is-success {
    color: #15803d;
    background: #e8f7ee;
}

.auth-badge.is-danger {
    color: #dc2626;
    background: #fdecec;
}

.auth-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.65rem;
    color: #1e2a4a;
    text-align: center;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

.auth-subtitle strong {
    color: #1f2937;
    word-break: break-word;
}

.auth-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.45rem;
}

.auth-label .optional {
    font-weight: 400;
    color: #9ca3af;
}

.auth-field {
    position: relative;
}

.auth-field .field-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
}

/* Styles inputs whether or not the form widget sets class="form-control". */
.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 3rem 0 2.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 0.975rem;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-field input::placeholder {
    color: #9ca3af;
}

.auth-field input:focus {
    border-color: #6d4bb3;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(109, 75, 179, 0.15);
}

.auth-field:focus-within .field-icon {
    color: #6d4bb3;
}

.auth-field.has-error input {
    border-color: #f87171;
    background: #fffafa;
}

.toggle-password {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9ca3af;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    line-height: 1;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: #4b2c7a;
    outline: none;
    background: #f3f0fa;
}

.field-error {
    color: #dc2626;
    font-size: 0.825rem;
    margin-top: 0.4rem;
}

.field-help {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.4rem;
    line-height: 1.45;
}

/* Django's password rules come as a <ul>; keep them compact. */
.field-help ul {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
}

/* Account type choice (Admin / Normal User) as two selectable cards */
.type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.type-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    height: 100%;
    padding: 0.9rem 0.95rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.type-option:hover .type-card {
    border-color: #c9bde6;
}

.type-option input:checked + .type-card {
    border-color: #6d4bb3;
    background: #f6f2fd;
    box-shadow: 0 0 0 3px rgba(109, 75, 179, 0.12);
}

.type-option input:focus-visible + .type-card {
    box-shadow: 0 0 0 4px rgba(109, 75, 179, 0.25);
}

.type-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ede9f8;
    color: #6d4bb3;
    font-size: 0.95rem;
}

.type-name {
    font-weight: 600;
    font-size: 0.925rem;
    color: #1f2937;
}

.type-desc {
    font-size: 0.775rem;
    line-height: 1.4;
    color: #6b7280;
}

@media (max-width: 380px) {
    .type-options {
        grid-template-columns: 1fr;
    }
}

/* Admin access code: hidden until Admin is picked. Without JavaScript, the
   server re-shows it with an error if Admin was chosen without a code. */
.admin-code-group.js-hidden,
.admin-code-group[hidden] {
    display: none;
}

/* Optional profile photo picker */
.auth-file {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0.9rem;
    border: 1.5px dashed #d6d3e0;
    border-radius: 12px;
    background: #fbfaff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.auth-file:hover,
.auth-file:focus-within {
    border-color: #6d4bb3;
    background: #f6f2fd;
}

.auth-file-preview {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #ede9f8 center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6d4bb3;
}

.auth-file-text {
    min-width: 0;
    font-size: 0.875rem;
    color: #4b5563;
}

.auth-file-text strong {
    display: block;
    color: #4b2c7a;
    font-weight: 600;
}

.auth-file-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-file input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* 6-digit verification code */
.auth-code {
    display: block;
    width: 100%;
    height: 62px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: 0.55em;
    padding-left: 0.55em;
    color: #1e2a4a;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-code::placeholder {
    color: #d1d5db;
}

.auth-code:focus {
    border-color: #6d4bb3;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(109, 75, 179, 0.15);
}

.auth-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6d4bb3;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
}

.auth-link:hover {
    color: #4b2c7a;
    text-decoration: underline;
}

.btn-auth {
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2c3e50 0%, #4b2c7a 100%);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.02rem;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 20px rgba(75, 44, 122, 0.3);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-auth:hover,
.btn-auth:focus-visible {
    color: #ffffff;
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(75, 44, 122, 0.38);
}

.btn-auth:active {
    transform: translateY(0);
}

.btn-auth-outline {
    height: 50px;
    border-radius: 12px;
    border: 1.5px solid #ddd6ee;
    background: #ffffff;
    color: #4b2c7a;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-auth-outline:hover {
    background: #f6f2fd;
    border-color: #6d4bb3;
    color: #4b2c7a;
}

.auth-alert {
    border: 0;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
}

.auth-note {
    font-size: 0.85rem;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    line-height: 1.5;
}

.auth-footer {
    background: #f9fafb;
    border-top: 1px solid #f0f0f3;
    padding: 1.1rem;
    text-align: center;
    font-size: 0.925rem;
    color: #6b7280;
}

.auth-footer a {
    color: #6d4bb3;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-motto {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 1.75rem;
}

.auth-motto .motto-label {
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.3rem;
}

.auth-motto .motto-text {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-weight: 500;
    font-size: 1.05rem;
    margin: 0;
}

@media (max-width: 480px) {
    .auth-page {
        padding: 2rem 1rem;
    }

    .auth-card-body {
        padding: 2rem 1.4rem 1.6rem;
    }

    .auth-title {
        font-size: 1.45rem;
    }
}
