/* =========================================================
   e-JIPIME — account pages
   Register, Verify email, Complete profile
   Works on its own; Bootstrap is optional.
   ========================================================= */

:root {
    --auth-accent:       #bd2a13;   /* main action colour */
    --auth-accent-dark:  #9f2412;
    --auth-accent-soft:  rgba(189, 42, 19, .10);
    --auth-ring:         rgba(189, 42, 19, .18);

    --auth-navy:         #1f2d3d;   /* same as the dashboard sidebar */
    --auth-navy-dark:    #111c24;
    --auth-gold:         #ffc107;

    --auth-bg:           #eef1f5;
    --auth-card:         #ffffff;
    --auth-text:         #1f2d3d;
    --auth-muted:        #6c757d;
    --auth-border:       #dde2e8;
    --auth-field:        #f8f9fb;
    --auth-success:      #198754;
    --auth-danger:       #dc3545;
}

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

body.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 193, 7, .10) 0, transparent 38%),
        radial-gradient(circle at 88% 82%, rgba(189, 42, 19, .08) 0, transparent 40%),
        var(--auth-bg);
    color: var(--auth-text);
    font-family: "Source Sans Pro", "Segoe UI", -apple-system, Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* ---------------------------------------------------------
   Card shell: brand panel + form panel
   --------------------------------------------------------- */

.auth-shell {
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 5fr 7fr;
    background: var(--auth-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(17, 28, 36, .16), 0 2px 6px rgba(17, 28, 36, .06);
}

.auth-shell.narrow { max-width: 880px; }
.auth-shell.wide   { max-width: 1060px; }

/* Brand panel */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 44px 38px;
    background: linear-gradient(160deg, var(--auth-navy) 0%, var(--auth-navy-dark) 100%);
    color: #fff;
    overflow: hidden;
}

.auth-brand::after {          /* soft decorative circle */
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 193, 7, .18), transparent 70%);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.auth-logo .mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 193, 7, .14);
    color: var(--auth-gold);
    font-size: 1.3rem;
}

.auth-logo .name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--auth-gold);
}

.auth-brand h2 {
    margin: 38px 0 10px;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.25;
}

.auth-brand .lead {
    margin: 0;
    color: rgba(255, 255, 255, .72);
}

.auth-features {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
}

.auth-features li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, .85);
}

.auth-features .ico {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .08);
    color: var(--auth-gold);
    font-size: .85rem;
}

.auth-features strong { display: block; color: #fff; font-weight: 600; }
.auth-features small  { color: rgba(255, 255, 255, .6); }

.auth-brand-footer {
    margin-top: auto;
    padding-top: 30px;
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, .5);
    font-size: .8rem;
}

/* Form panel */
.auth-main {
    padding: 46px 44px;
}

.auth-header {
    margin-bottom: 26px;
}

.auth-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
    font-size: 1.45rem;
}

.auth-header h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
}

/* ---------------------------------------------------------
   Fields
   --------------------------------------------------------- */

.auth-field { margin-bottom: 18px; }

.auth-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: .92rem;
    color: #3d4852;
}

.auth-label .req { color: var(--auth-accent); margin-left: 2px; }
.auth-label .hint { font-weight: 400; font-size: .8rem; color: var(--auth-muted); }

.auth-input {
    position: relative;
}

.auth-input > .lead-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa5b1;
    pointer-events: none;
    font-size: .95rem;
    transition: color .15s ease;
}

/* Style whatever Django renders inside .auth-input */
.auth-input input,
.auth-input select {
    width: 100%;
    height: 48px;
    padding: 0 15px 0 44px;
    border: 1.5px solid var(--auth-border);
    border-radius: 11px;
    background-color: var(--auth-field);
    color: var(--auth-text);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    appearance: none;
    -webkit-appearance: none;
}

.auth-input select {
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236c757d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.auth-input input::placeholder { color: #a8b1bb; }

.auth-input input:focus,
.auth-input select:focus {
    outline: none;
    border-color: var(--auth-accent);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--auth-ring);
}

.auth-input:focus-within > .lead-icon { color: var(--auth-accent); }

.auth-input input:disabled,
.auth-input select:disabled {
    cursor: not-allowed;
    background-color: #f1f3f5;
    color: #9aa5b1;
}

.auth-input.has-toggle input { padding-right: 48px; }

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8a95a1;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    outline: none;
    color: var(--auth-accent);
    background: var(--auth-accent-soft);
}

.auth-field.has-error .auth-input input,
.auth-field.has-error .auth-input select {
    border-color: var(--auth-danger);
    background-color: #fff8f8;
}

.field-error {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    margin-top: 6px;
    color: var(--auth-danger);
    font-size: .82rem;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: .8rem;
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

/* ---------------------------------------------------------
   Alerts
   --------------------------------------------------------- */

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: .9rem;
    border: 1px solid transparent;
}

.auth-alert ul { margin: 0; padding-left: 16px; }
.auth-alert.danger  { background: #fdecec; border-color: #f6c6c6; color: #8a1c1c; }
.auth-alert.success { background: #e8f6ee; border-color: #bfe5cf; color: #0f5132; }
.auth-alert.warning { background: #fff6e0; border-color: #ffe1a1; color: #7a5300; }
.auth-alert.info    { background: #e8f1fd; border-color: #c4dbfa; color: #0b4a8b; }

/* ---------------------------------------------------------
   Buttons and links
   --------------------------------------------------------- */

.btn-auth {
    width: 100%;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-accent) 0%, #d8401f 100%);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(189, 42, 19, .25);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(189, 42, 19, .3); filter: brightness(1.03); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--auth-ring), 0 8px 18px rgba(189, 42, 19, .25); }
.btn-auth:disabled { opacity: .75; cursor: not-allowed; transform: none; }

.auth-link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover { color: var(--auth-accent-dark); text-decoration: underline; }
.auth-link.disabled { pointer-events: none; opacity: .55; }

.auth-switch {
    margin-top: 22px;
    text-align: center;
    color: var(--auth-muted);
}

.auth-divider {
    height: 1px;
    margin: 24px 0;
    background: var(--auth-border);
}

.auth-note {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    color: var(--auth-muted);
    font-size: .82rem;
}

/* Small inline spinner (no Bootstrap needed) */
.auth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

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

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 860px) {
    body.auth-page { padding: 14px; align-items: flex-start; }

    .auth-shell,
    .auth-shell.narrow,
    .auth-shell.wide { grid-template-columns: 1fr; max-width: 560px; }

    .auth-brand { padding: 22px 26px; }
    .auth-brand h2,
    .auth-brand .lead,
    .auth-features,
    .auth-brand-footer { display: none; }

    .auth-main { padding: 30px 26px; }
}

@media (max-width: 480px) {
    .auth-main { padding: 26px 18px; }
    .auth-header h1 { font-size: 1.35rem; }
    .auth-grid-2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   Small helpers (so Bootstrap is not required)
   --------------------------------------------------------- */

.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center !important; }
.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;
}
