/* caminho: static/css/custom.css */

/* =========================================================
   VARIÁVEIS E TEMA
   ========================================================= */
:root {
    --color-primary:       #04436E;
    --color-primary-dark:  #032f50;
    --color-primary-light: #065a96;
    --color-primary-muted: rgba(4, 67, 110, 0.08);
    --color-accent:        #00ABC5;
    --color-accent-dark:   #007f94;
}

/* =========================================================
   GLOBAL
   ========================================================= */
body {
    background: linear-gradient(180deg, #B7C5CF 0%, #ffffff 75%);
    background-attachment: fixed;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #212529;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* =========================================================
   NAVBAR
   ========================================================= */
/* ── Navbar UNIFENAS (frosted glass) ── */
.navbar-unifenas {
    background-color: rgba(183, 197, 207, 0.82) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(183, 197, 207, 0.4);
}

.navbar-unifenas .navbar-brand,
.navbar-unifenas .nav-link {
    color: var(--color-primary) !important;
    font-weight: 500;
}

.navbar-unifenas .nav-link:hover,
.navbar-unifenas .nav-link:focus {
    color: var(--color-accent) !important;
}

.navbar-unifenas .navbar-toggler {
    border-color: rgba(4, 67, 110, 0.3);
}

.navbar-logo {
    max-height: 42px;
    object-fit: contain;
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(4, 67, 110, 0.25);
}

.dropdown-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 6px;
    border: 3px solid var(--color-primary-muted);
}

/* =========================================================
   AUTH PAGE — tela de login
   ========================================================= */
.auth-page {
    background-color: var(--color-primary);
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(0,0,0,0.12) 0%, transparent 60%);
    min-height: 100vh;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-card {
    border-radius: 14px;
}

.auth-logo {
    max-height: 90px;
    max-width: 240px;
    object-fit: contain;
}

/* --- Campos estilo sublinhado --- */
.auth-field {
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid #ced4da;
    padding-bottom: 2px;
    transition: border-color 0.2s ease;
}

.auth-field:focus-within {
    border-bottom-color: var(--color-accent);
}

.auth-field-icon {
    color: #9e9e9e;
    font-size: 1.1rem;
    padding: 0 10px 0 2px;
    transition: color 0.2s ease;
}

.auth-field:focus-within .auth-field-icon {
    color: var(--color-accent);
}

.auth-field input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 0.95rem;
    color: #333;
}

.auth-field input::placeholder {
    color: #aaa;
    font-size: 0.9rem;
}

/* --- Botão Entrar --- */
.btn-auth {
    background-color: var(--color-primary);
    border: none;
    color: #fff;
    padding: 12px;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-auth:hover {
    background-color: var(--color-primary-dark);
    color: #fff;
}

.btn-auth:active {
    transform: scale(0.99);
}

/* --- Link "Esqueceu a senha?" --- */
.auth-link {
    color: var(--color-accent);
    text-decoration: none;
}

.auth-link:hover {
    color: var(--color-accent-dark);
    text-decoration: underline;
}

/* =========================================================
   PERFIL — foto do aluno
   ========================================================= */
.perfil-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-primary-muted);
    display: block;
    margin: 0 auto;
}

.perfil-avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: var(--color-primary-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--color-primary);
}

/* =========================================================
   DASHBOARD — chips de resumo acadêmico
   ========================================================= */
.dash-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.dash-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(4, 67, 110, 0.05);
    border: 1px solid rgba(4, 67, 110, 0.12);
    border-radius: 10px;
    padding: 9px 14px;
}

.dash-chip-icon {
    font-size: 1.15rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.dash-chip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-chip-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #aaa;
    font-weight: 700;
    line-height: 1;
}

.dash-chip-value {
    font-size: 12.5px;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
}

/* Status: matriculado */
.dash-chip-ok {
    background: rgba(25, 135, 84, 0.07);
    border-color: rgba(25, 135, 84, 0.2);
}

.dash-chip-ok .dash-chip-icon {
    color: #198754;
}

/* Status: sem matrícula */
.dash-chip-warn {
    background: rgba(108, 117, 125, 0.07);
    border-color: rgba(108, 117, 125, 0.2);
}

.dash-chip-warn .dash-chip-icon {
    color: #6c757d;
}

/* =========================================================
   DASHBOARD — cards de acesso rápido
   ========================================================= */
.dashboard-card {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    border-top: 3px solid var(--color-accent) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-top-color 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
    border-top-color: var(--color-primary) !important;
}

.dashboard-card-arrow {
    position: absolute;
    bottom: 14px;
    right: 16px;
    color: #ddd;
    font-size: 0.85rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.dashboard-card:hover .dashboard-card-arrow {
    color: var(--color-accent);
    transform: translateX(3px);
}

.dashboard-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: rgba(0, 171, 197, 0.12);
    border: 1px solid rgba(0, 171, 197, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: background-color 0.2s ease;
}

.dashboard-card:hover .dashboard-icon {
    background-color: rgba(4, 67, 110, 0.1);
    border-color: rgba(4, 67, 110, 0.2);
}

.dashboard-icon i {
    font-size: 1.7rem;
    color: var(--color-primary);
}

/* =========================================================
   CARTEIRINHA ESTUDANTIL
   ========================================================= */
.crt-card {
    width: 360px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.25);
    background: #c8ddef;
    font-family: Arial, Helvetica, sans-serif;
}

/* ── TOP ── */
.crt-top {
    background: #c8ddef;
    padding: 20px 22px 0 22px;
}

.crt-logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4px;
}

.crt-logo-block img {
    width: 160px;
    height: auto;
}

.crt-logo-sub {
    font-size: 10px;
    color: #4a7eb5;
    text-align: center;
    font-style: italic;
    margin-top: 3px;
    letter-spacing: 0.2px;
}

.crt-divider {
    border: none;
    border-top: 1px solid rgba(74, 126, 181, 0.25);
    margin: 10px 0;
}

.crt-field {
    margin-bottom: 6px;
}

.crt-label {
    font-size: 10.5px;
    font-weight: 400;
    color: #4a7eb5;
    display: block;
}

.crt-value {
    font-size: 12px;
    font-weight: 700;
    color: #111;
    display: block;
}

.crt-value-curso {
    font-size: 12.5px;
    text-transform: uppercase;
}

.crt-value-nome {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.crt-row-inline {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 6px;
}

.crt-inline-group {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.crt-inline-label {
    font-size: 10.5px;
    color: #4a7eb5;
    white-space: nowrap;
}

.crt-inline-value {
    font-size: 12px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

/* ── WAVE ── */
.crt-wave {
    height: 62px;
    margin-top: 6px;
}

.crt-wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── BOTTOM ── */
.crt-bottom {
    background: #1a3060;
    padding: 16px 22px 22px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.crt-validade-block {
    flex: 1;
}

.crt-validade-label {
    font-size: 11px;
    color: #90bcdf;
    font-weight: 400;
}

.crt-validade-date {
    font-size: 20px;
    color: #fff;
    font-weight: 700;
    margin-top: 1px;
}

/* ── PHOTO BOX ── */
.crt-foto-box {
    width: 100px;
    height: 112px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #5a8ac0;
    gap: 6px;
}

.crt-foto-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crt-foto-icon {
    fill: #7ab0e0;
    width: 28px;
    height: 28px;
}

.crt-foto-text {
    font-size: 10.5px;
    color: #90bcdf;
    text-align: center;
    line-height: 1.4;
}

/* ── CAROUSEL WRAPPER ── */
.crt-carousel-outer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crt-carousel-outer .carousel {
    width: 360px;
    flex-shrink: 0;
}

.crt-arrow {
    background: none;
    border: none;
    color: #bbb;
    font-size: 1.4rem;
    padding: 6px 8px;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
    line-height: 1;
    border-radius: 50%;
}

.crt-arrow:hover {
    color: var(--color-primary);
    background: rgba(21, 101, 192, 0.06);
}

/* Dots de navegação */
.crt-dots-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-top: 10px;
}

.crt-dot {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}

.crt-dot::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.2s, transform 0.2s;
}

.crt-dot.active::before {
    background: var(--color-accent);
    transform: scale(1.3);
}

.crt-dot span {
    font-size: 11px;
    color: #aaa;
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: color 0.2s;
}

.crt-dot.active span {
    color: var(--color-accent);
    font-weight: 600;
}

/* ── VERSO (QR placeholder) ── */
.crt-card-verso {
    background: #ffffff;
    min-height: 383px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.crt-verso-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 22px;
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
}

.crt-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.crt-qr-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 4px;
}

.crt-qr-label {
    font-size: 11px;
    color: #888;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.crt-verso-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.crt-verso-ra {
    font-size: 12px;
    color: #555;
}

.crt-verso-nome {
    font-size: 11px;
    color: #999;
    letter-spacing: 0.3px;
}

/* ── TIMESTAMP ── */
.crt-timestamp {
    text-align: center;
    font-size: 11px;
    color: #9e9e9e;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* ── PRINT ── */
@media print {
    .no-print,
    nav,
    footer { display: none !important; }

    body { background: none !important; }
    main { padding: 0 !important; }
    .row { display: block !important; }

    .crt-carousel-outer { display: block !important; }

    .carousel-inner { overflow: visible; }
    .carousel-item { display: none !important; }
    .carousel-item.active {
        display: block !important;
        position: static;
    }

    .crt-card {
        box-shadow: none;
        margin: 0 auto;
    }
}
