/* =======================================================
   DYWARD - SYSTEM DESIGN & MODERN DARK THEME STYLESHEET
   ======================================================= */

:root {
    --bg-dark: #07090e;
    --bg-surface: #0f172a;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-cyan: #38bdf8;
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* =======================================================
   PLANO DE FUNDO DINÂMICO E BRILHOS
   ======================================================= */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #0284c7 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
}

.bg-grid-pattern {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* =======================================================
   NAVBAR & HEADER
   ======================================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #0284c7, #6366f1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.5px;
    display: block;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    color: #34d399;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

/* =======================================================
   HERO SECTION
   ======================================================= */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px 30px;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =======================================================
   APPS GRID (CARDS DA CENTRAL)
   ======================================================= */
.apps-grid-section {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 20px 24px 60px;
}

.grid-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.app-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.15);
}

.card-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-blue {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-purple {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.icon-cyan {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.icon-indigo {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-open-app {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.app-card:hover .btn-open-app {
    background: var(--accent-cyan);
    color: #090d16;
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

/* =======================================================
   MODAL / POPUP OVERLAY GIGANTE
   ======================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 9, 14, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease-in-out;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-window {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    width: 92%;
    max-width: 950px;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
    transform: scale(0.95);
    transition: transform 0.25s ease-in-out, height 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-window {
    transform: scale(1);
}

.modal-header {
    background: rgba(15, 23, 42, 0.95);
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-header-title h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.modal-header-title p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modal-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.modal-body {
    flex: 1;
    padding: 18px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* =======================================================
   FORMULÁRIOS DENTRO DOS MODAIS
   ======================================================= */
.app-form {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid.single-col {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
}

.input-wrapper input {
    width: 100%;
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.btn-toggle-pwd {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
}

.btn-toggle-pwd:hover {
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-submit {
    border: none;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn-cyan {
    background: linear-gradient(135deg, #0284c7, #0284c7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.btn-cyan:hover {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-indigo {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-indigo:hover {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* =======================================================
   PAINEL DE RESULTADOS
   ======================================================= */
.results-container {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 18px;
    margin-top: 18px;
    animation: fadeIn 0.3s ease;
}

.results-container.hidden {
    display: none;
}

.results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
}

.text-emerald { color: var(--accent-emerald); }
.text-cyan { color: var(--accent-cyan); }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.res-item {
    background: #090d16;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 14px;
}

.res-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.res-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

.footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .hero-title { font-size: 28px; }
    .modal-window { width: 96%; height: 92vh; padding: 0; }
    .modal-body { padding: 16px; }
}

.hidden {
    display: none !important;
}

