﻿/* ===== SHERQ – Identity (Grupo A) ===== */
:root {
    --brand-900: #003366;
    --brand-700: #004080;
    --brand-500: #1a5fa8;
    --brand-50: #eef3f9;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #d9dee5;
    --surface: #ffffff;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --radius: 14px;
    --accent: #f5b700;
    --sky: #19b5e6;
    --shadow: 0 30px 70px rgba(0, 10, 30, .45), 0 0 0 1px rgba(255, 255, 255, .06);
}

.auth-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(.75rem, 4vw, 2.5rem);
    background: #002f63;
}
    /* camada fixa: ocupa sempre a pagina toda, independente do layout */
    .auth-page::before {
        content: "";
        position: fixed;
        inset: -8%;
        z-index: -1;
        background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .045) 0 90px, transparent 90px 180px), radial-gradient(55% 60% at 100% 0%, rgba(25, 181, 230, .60) 0%, transparent 65%), radial-gradient(45% 50% at 0% 100%, rgba(25, 181, 230, .22) 0%, transparent 65%), linear-gradient(135deg, #001a3d 0%, #003a78 50%, #0a5cb8 100%);
        animation: auth-drift 50s ease-in-out infinite alternate;
        pointer-events: none;
    }

body:has(.auth-page) {
    margin: 0;
    background: #002f63;
}

@keyframes auth-drift {
    from {
        transform: scale(1) translate3d(0, 0, 0);
    }

    to {
        transform: scale(1.06) translate3d(-1.5%, 1%, 0);
    }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-card--md {
    max-width: 520px;
}

.auth-card--lg {
    max-width: 620px;
}

/* Header */
.auth-header {
    position: relative;
    padding: clamp(1.5rem, 4vw, 2.25rem) 1.5rem;
    text-align: center;
    color: #fff;
    background: radial-gradient(70% 140% at 100% 0%, rgba(25, 181, 230, .40), transparent 70%), linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    overflow: hidden;
}

    .auth-header::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 6px;
        background: repeating-linear-gradient(135deg, var(--accent) 0 10px, var(--brand-900) 10px 20px);
    }

.auth-logo {
    height: 52px;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.auth-title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
    font-weight: 700;
}

.auth-subtitle {
    position: relative;
    z-index: 1;
    margin: .4rem 0 0;
    font-size: .9rem;
    opacity: .85;
}

/* Body */
.auth-body {
    padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-body--center {
    text-align: center;
    padding: clamp(1.75rem, 5vw, 2.75rem);
    border-top: 6px solid transparent;
    border-image: repeating-linear-gradient(135deg, var(--accent) 0 10px, var(--brand-900) 10px 20px) 1;
}

/* Status pages */
.auth-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.9rem;
    background: var(--brand-50);
    color: var(--brand-700);
}

.auth-icon--success {
    background: #e8f5ee;
    color: var(--success);
}

.auth-icon--danger {
    background: #fdecee;
    color: var(--danger);
}

.auth-heading {
    color: var(--brand-900);
    font-weight: 700;
    font-size: clamp(1.3rem, 1rem + 1vw, 1.6rem);
    margin-bottom: .75rem;
}

.auth-text {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

/* Forms */
.auth-card .form-label {
    font-weight: 500;
    color: var(--ink);
    font-size: .9rem;
    margin-bottom: .35rem;
}

.auth-card .input-group-text {
    background: var(--brand-50);
    color: var(--brand-700);
    border: 1px solid var(--line);
    border-right: 0;
}

.auth-card .form-control {
    border: 1px solid var(--line);
    border-left: 0;
    padding: .7rem .9rem;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}

.auth-card .input-group > .form-control:not(:last-child) {
    border-right: 0;
}

.auth-card .form-control:focus {
    border-color: var(--brand-700);
    box-shadow: none;
}

.auth-card .input-group:focus-within {
    border-radius: 8px;
    box-shadow: 0 0 0 .2rem rgba(0, 64, 128, .22);
}

    .auth-card .input-group:focus-within .input-group-text,
    .auth-card .input-group:focus-within .form-control,
    .auth-card .input-group:focus-within .btn-toggle {
        border-color: var(--brand-700);
    }

.auth-card .form-control.is-invalid {
    border-color: var(--danger);
    background-image: none;
}

.btn-toggle {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 0;
    color: var(--muted);
}

    .btn-toggle:hover, .btn-toggle:focus-visible {
        color: var(--brand-700);
        background: var(--brand-50);
    }

.form-check-input:checked {
    background-color: var(--brand-700);
    border-color: var(--brand-700);
}

.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(0, 64, 128, .25);
    border-color: var(--brand-700);
}

/* Buttons */
.btn-brand {
    width: 100%;
    padding: .8rem 1rem;
    font-weight: 600;
    letter-spacing: .3px;
    color: #fff;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 100%);
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

    .btn-brand:hover, .btn-brand:focus-visible {
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 8px 18px rgba(0, 64, 128, .3);
    }

    .btn-brand:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.btn-outline-brand {
    width: 100%;
    padding: .8rem 1rem;
    font-weight: 600;
    color: var(--brand-700);
    border: 1px solid var(--brand-700);
    border-radius: 8px;
    background: transparent;
    transition: background .2s, color .2s;
}

    .btn-outline-brand:hover, .btn-outline-brand:focus-visible {
        color: #fff;
        background: var(--brand-700);
    }

.auth-link {
    color: var(--brand-700);
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}

    .auth-link:hover {
        color: var(--brand-900);
        text-decoration: underline;
    }

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

/* Validation */
.field-error {
    display: none;
    margin-top: .25rem;
    font-size: .875rem;
    color: var(--danger);
}

    .field-error.show {
        display: block;
    }

/* Password strength */
.password-strength {
    height: 5px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: #e9ecef;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width .3s, background-color .3s;
}

/* Loading overlay */
#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(2px);
}

.spinner-container {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid var(--brand-50);
    border-top-color: var(--brand-700);
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
}

.loading-text {
    color: var(--brand-900);
    font-weight: 500;
    margin: 0;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 575.98px) {
    .auth-card {
        border-radius: 12px;
    }

        .auth-card .form-control {
            font-size: 16px;
        }
    /* evita zoom no iOS */
    .auth-logo {
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page::before {
        animation: none;
    }

    * {
        transition: none !important;
        animation-duration: 1.5s !important;
    }
}

/* ===== Login em duas colunas ===== */
.auth-card--split {
    --field: #eaf0fb;
    max-width: 1000px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 3.5rem) 2rem;
    text-align: center;
    color: #fff;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 90px, transparent 90px 180px), radial-gradient(80% 55% at 0% 100%, rgba(25, 181, 230, .38), transparent 70%), linear-gradient(160deg, #001a3d 0%, #003366 60%, #004a99 100%);
}

    .auth-aside::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        width: 6px;
        background: repeating-linear-gradient(135deg, var(--accent) 0 10px, var(--brand-900) 10px 20px);
    }

    .auth-aside .auth-logo {
        height: auto;
        width: min(260px, 70%);
        margin-bottom: 1.75rem;
    }

.auth-aside-title {
    margin: 0 0 .5rem;
    font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
    font-weight: 700;
}

.auth-aside-text {
    margin: 0;
    max-width: 28ch;
    font-size: .95rem;
    opacity: .8;
}

.auth-split-body {
    padding: clamp(1.5rem, 5vw, 3rem);
    align-self: center;
}

    .auth-split-body h2 {
        margin: 0 0 .25rem;
        font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
        font-weight: 700;
        color: var(--brand-900);
    }

    .auth-split-body .lead-text {
        margin: 0 0 1.5rem;
        color: var(--muted);
    }

.auth-tabs {
    display: flex;
    gap: .25rem;
    padding: .3rem;
    margin-bottom: 1.75rem;
    background: #f1f3f6;
    border-radius: 12px;
}

    .auth-tabs a {
        flex: 1;
        padding: .65rem .5rem;
        white-space: nowrap;
        text-align: center;
        border-radius: 9px;
        color: var(--muted);
        font-weight: 500;
        text-decoration: none;
        transition: color .2s, background .2s;
    }

        .auth-tabs a:hover {
            color: var(--brand-900);
        }

        .auth-tabs a.active {
            background: #fff;
            color: var(--brand-700);
            box-shadow: 0 1px 4px rgba(0, 30, 70, .16);
        }

/* campos preenchidos */
.auth-card--split .input-group-text,
.auth-card--split .form-control,
.auth-card--split .btn-toggle {
    background: var(--field);
    border-color: transparent;
}

.auth-card--split .form-control {
    padding: .85rem .9rem;
}

@media (max-width: 767.98px) {
    .auth-card--split {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .auth-aside {
        padding: 1.5rem;
    }

        .auth-aside .auth-logo {
            width: 150px;
            margin-bottom: .75rem;
        }

    .auth-aside-text {
        display: none;
    }

    .auth-aside-title {
        margin: 0;
        font-size: 1.1rem;
    }

    .auth-aside::after {
        top: auto;
        left: 0;
        width: auto;
        height: 6px;
    }
}
