/**
 * TeraVersa theme — auth, app shell, banner Ken Burns, komponen.
 * Muat SETELAH tokens.css. Bootstrap 5 opsional (class .btn ikut di-skin).
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap");

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

html { min-height: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

img { max-width: 100%; height: auto; }

/* ==========================================================================
   Banner foto + zoom Ken Burns (login & hero)
   ========================================================================== */

.tv-banner,
.hero-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.tv-banner img,
.hero-bg img {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    object-fit: cover;
    transform-origin: 55% 40%;
    animation: tv-kenburns 32s ease-in-out infinite alternate;
    filter: saturate(0.88) brightness(0.52);
}

.tv-banner::after,
.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 86% -14%, rgba(252, 199, 65, 0.18), transparent 44%),
        radial-gradient(circle at 10% 112%, rgba(86, 112, 174, 0.28), transparent 38%),
        linear-gradient(to bottom right, rgba(18, 40, 87, 0.72), rgba(28, 54, 117, 0.58) 55%, rgba(36, 64, 124, 0.62));
    z-index: 1;
}

@keyframes tv-kenburns {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.16) translate(-2.4%, -1.6%); }
}

.tv-banner--static img,
.hero-bg--static img {
    animation: none;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Halaman login / auth
   ========================================================================== */

body.tv-auth,
body.unsoed-auth {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 86% -14%, rgba(108, 145, 229, 0.26), transparent 44%),
        radial-gradient(circle at 10% 112%, rgba(86, 112, 174, 0.22), transparent 36%),
        linear-gradient(to bottom right, #122857, #1b336f 55%, #24407c);
    color: var(--text-primary);
}

body.tv-auth::before,
body.unsoed-auth::before {
    content: "";
    position: fixed;
    width: 560px;
    height: 420px;
    top: -128px;
    right: -96px;
    border-radius: 999px;
    pointer-events: none;
    background: rgba(86, 112, 174, 0.42);
    filter: blur(72px);
    z-index: 0;
    animation: tv-blob 14s ease-in-out infinite alternate;
}

body.tv-auth::after,
body.unsoed-auth::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.62;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100 C 20 0 50 0 100 100 Z' fill='%235b78bd'/%3E%3C/svg%3E");
    background-size: 100% 74%;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 0;
}

@keyframes tv-blob {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.18) translate(-24px, 18px); }
}

.tv-auth .auth-page,
.unsoed-auth .auth-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.tv-auth .auth-card,
.unsoed-auth .auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    background: linear-gradient(180deg, rgba(17, 39, 86, 0.86) 0%, rgba(12, 32, 76, 0.82) 100%);
    border: 1px solid rgba(166, 195, 255, 0.32);
    border-radius: var(--radius-lg);
    box-shadow: 0 22px 48px rgba(5, 16, 44, 0.42);
    backdrop-filter: blur(8px);
    padding: 1.6rem;
}

.tv-auth .auth-logo,
.unsoed-auth .auth-logo {
    width: 230px;
    max-width: 100%;
    display: block;
    margin: 0 auto 0.7rem;
}

.tv-auth .auth-subtitle,
.unsoed-auth .auth-subtitle {
    text-align: center;
    color: rgba(224, 234, 255, 0.86);
    font-weight: 500;
    margin: 0 0 1.1rem;
}

.tv-auth .auth-helper,
.unsoed-auth .auth-helper {
    border: 1px solid rgba(144, 174, 236, 0.32);
    background: linear-gradient(180deg, rgba(30, 57, 115, 0.62) 0%, rgba(25, 50, 105, 0.56) 100%);
    border-radius: var(--radius-md);
    padding: 0.86rem 0.9rem;
    margin-bottom: 1.1rem;
    font-size: 0.88rem;
    color: rgba(222, 233, 255, 0.93);
}

.tv-auth .auth-actions,
.unsoed-auth .auth-actions { display: grid; gap: 0.9rem; }

.tv-auth .auth-btn,
.unsoed-auth .auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.tv-auth .auth-btn:hover,
.unsoed-auth .auth-btn:hover { transform: translateY(-1px); }

.tv-auth .auth-btn-civitas,
.unsoed-auth .auth-btn-civitas,
.btn.auth-btn-civitas {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: #2f57ad;
    border-color: #2f57ad;
    box-shadow: 0 12px 26px rgba(47, 87, 173, 0.38);
}

.tv-auth .auth-btn-civitas::after,
.unsoed-auth .auth-btn-civitas::after {
    content: "";
    position: absolute;
    top: -18%;
    left: -38%;
    width: 28%;
    height: 136%;
    pointer-events: none;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(252, 199, 65, 0.12) 36%,
        rgba(252, 199, 65, 0.38) 50%,
        rgba(252, 199, 65, 0.12) 64%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-18deg);
    animation: tv-civitas-shimmer 2.8s ease-in-out infinite;
}

@keyframes tv-civitas-shimmer {
    0% { left: -42%; opacity: 0; }
    12% { opacity: 1; }
    42% { left: 118%; opacity: 0.96; }
    100% { left: 118%; opacity: 0; }
}

.tv-auth .auth-btn-external,
.unsoed-auth .auth-btn-external {
    color: #fff;
    background: #0f766e;
    border-color: #0f766e;
    box-shadow: 0 10px 22px rgba(13, 148, 136, 0.34);
}

.tv-auth .auth-btn-note,
.unsoed-auth .auth-btn-note {
    margin: 0.42rem 0 0;
    text-align: center;
    color: rgba(201, 218, 248, 0.86);
    font-size: 0.82rem;
}

.tv-auth .auth-footer-note,
.unsoed-auth .auth-footer-note {
    margin-top: 1rem;
    font-size: 0.83rem;
    color: rgba(222, 233, 255, 0.9);
    border: 1px solid rgba(150, 180, 237, 0.3);
    background: rgba(33, 59, 113, 0.48);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
}

.tv-auth .auth-help-link,
.unsoed-auth .auth-help-link { color: rgba(189, 207, 242, 0.88); }

.tv-auth .auth-help-link a,
.unsoed-auth .auth-help-link a {
    color: rgba(226, 238, 255, 0.98);
    font-weight: 600;
    text-decoration: none;
}

/* ==========================================================================
   Shell aplikasi setelah login
   ========================================================================== */

html:has(body.tv-app),
html:has(body.page-app) { min-height: 100%; }

body.tv-app,
body.page-app {
    margin: 0 auto;
    min-height: 100vh;
    width: 100%;
    max-width: var(--tv-max);
    background:
        radial-gradient(circle at 86% -14%, rgba(252, 199, 65, 0.20), transparent 44%),
        radial-gradient(circle at 10% 112%, rgba(252, 199, 65, 0.10), transparent 36%),
        linear-gradient(to bottom right, #122857, #1b336f 55%, #24407c);
    background-attachment: fixed;
    overflow-x: hidden;
}

body.tv-app::before,
body.page-app::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100 C 20 0 50 0 100 100 Z' fill='white'/%3E%3C/svg%3E");
    background-size: cover;
    z-index: 0;
}

.tv-shell,
body.tv-app .mobile-container,
body.page-app .mobile-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--tv-max);
    margin: 0 auto;
    min-height: 100vh;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.28);
    overflow-x: hidden;
    padding-bottom: calc(var(--tv-bottom-h) + 12px);
}

.tv-shell::before,
body.page-app .mobile-container::before,
body.tv-app .mobile-container::before {
    content: "";
    position: absolute;
    left: -16%;
    top: 90px;
    width: 132%;
    height: 640px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.02) 72%, transparent 100%);
    z-index: 0;
}

.tv-header,
body.tv-app .header,
body.page-app .header {
    position: relative;
    z-index: 2;
    overflow: hidden;
    padding: 14px 16px 12px;
    color: var(--text-on-brand);
    background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

.tv-header::before,
.tv-header::after,
body.tv-app .header::before,
body.tv-app .header::after,
body.page-app .header::before,
body.page-app .header::after {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 90%);
    animation: tv-float 6s ease-in-out infinite;
    pointer-events: none;
}

.tv-header::before,
body.tv-app .header::before,
body.page-app .header::before { top: -50%; right: -50%; }

.tv-header::after,
body.tv-app .header::after,
body.page-app .header::after { top: -30%; right: -30%; animation-delay: 1s; }

@keyframes tv-float {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.tv-user,
.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}

.tv-avatar,
.user-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    display: block;
}

.tv-user-name,
.user-details h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-on-brand);
}

.tv-user-role,
.user-details p {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    opacity: 0.85;
    color: var(--text-on-brand);
}

.tv-main,
body.tv-app .main-content,
body.page-app .main-content {
    position: relative;
    z-index: 1;
    padding: 0.85rem 0.9rem 1.25rem;
    background: transparent;
}

/* Bottom nav */
.tv-bottom,
body.tv-app .bottom-nav,
body.page-app .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--tv-max);
    z-index: 1060;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 6px 8px 8px;
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), 0 -8px 24px rgba(15, 23, 42, 0.1);
}

.tv-bottom-item,
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.25rem 0.2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
}

.tv-bottom-item.is-active,
.tv-bottom-item:hover { color: var(--navy-700); }

.tv-fab,
.qris-button {
    position: absolute;
    left: 50%;
    top: -22px;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold-300), var(--gold-200));
    box-shadow: 0 10px 22px rgba(252, 199, 65, 0.4);
    color: var(--navy-800);
    text-decoration: none;
    z-index: 1061;
}

/* ==========================================================================
   Komponen
   ========================================================================== */

.tv-panel,
.quick-actions {
    margin-bottom: 0.75rem;
    padding: 0.85rem;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.tv-panel-title,
.quick-actions h5 {
    margin: 0 0 0.8rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
}

.tv-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 0.7rem;
}

.tv-tile,
.service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.55rem 0.4rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tv-tile:hover,
.service-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
}

.tv-tile-icon,
.service-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

.tv-tile-icon img,
.service-icon img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.tv-card,
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    margin-bottom: 0.7rem;
    overflow: hidden;
}

.tv-card-header,
.card-header {
    padding: 0.75rem 0.95rem;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border-default);
    color: var(--text-heading);
    font-weight: 700;
}

.tv-card-body,
.card-body { padding: 0.9rem 0.95rem; }

.tv-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    color: var(--text-on-brand);
    background:
        linear-gradient(135deg, rgba(252, 199, 65, 0.14), transparent 42%),
        linear-gradient(160deg, var(--navy-800), var(--navy-700) 58%, #24407c);
    box-shadow: 0 10px 24px rgba(23, 49, 92, 0.18);
}

.tv-brand-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-300);
}

.tv-brand-title {
    margin: 0.15rem 0 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
}

.tv-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.36rem 0.78rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;
}

.tv-chip-gold { background: var(--gold-300); color: var(--navy-800); }
.tv-chip-navy { background: var(--navy-700); color: #fff; }

.tv-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
}

.tv-btn-primary,
.btn-primary {
    background: var(--navy-700);
    border-color: var(--navy-700);
    color: var(--text-on-brand);
}

.tv-btn-gold,
.btn-warning {
    background: var(--gold-300);
    border-color: var(--gold-300);
    color: var(--navy-800);
}

.tv-btn-ghost {
    background: transparent;
    border-color: var(--border-default);
    color: var(--navy-700);
}

.tv-input,
.tv-select,
.form-control,
.form-select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    font: inherit;
}

.tv-input:focus,
.form-control:focus {
    outline: 2px solid rgba(28, 54, 117, 0.25);
    border-color: var(--navy-700);
}

.tv-label,
.form-label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
    color: var(--navy-800);
}

.tv-alert,
.alert {
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.alert-success { background: #e8f6ee; color: #157347; border: 1px solid #c8ead6; }
.alert-danger { background: #fdecea; color: #b3362c; border: 1px solid #f5c6c2; }
.alert-warning { background: #fff6e5; color: #9a6700; border: 1px solid #f3e0b5; }
.alert-info { background: var(--navy-50); color: var(--navy-800); border: 1px solid var(--navy-200); }

.tv-highlight {
    background-image: linear-gradient(180deg, transparent 64%, var(--gold-300) 64%);
}

@media (min-width: 992px) {
    .tv-shell,
    body.tv-app,
    body.page-app,
    body.tv-app .mobile-container,
    body.page-app .mobile-container,
    .tv-bottom,
    body.tv-app .bottom-nav,
    body.page-app .bottom-nav { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .tv-banner img,
    .hero-bg img,
    body.tv-auth::before,
    body.unsoed-auth::before,
    .tv-header::before,
    .tv-header::after,
    body.tv-app .header::before,
    body.tv-app .header::after,
    .tv-auth .auth-btn-civitas::after,
    .unsoed-auth .auth-btn-civitas::after {
        animation: none;
    }
}
