/* ============================================
   SISTEMA DE AGENDAS PERPÉTUAS PRO — DESIGN
   Pamella Vieira Designer © 2026
   ============================================ */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: rgba(22, 18, 38, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --accent-1: #a855f7;
    --accent-2: #ec4899;
    --accent-3: #6366f1;
    --gradient-main: linear-gradient(135deg, #a855f7, #ec4899, #f97316);
    --gradient-btn: linear-gradient(135deg, #a855f7, #ec4899);
    --text-primary: #f0f0f5;
    --text-secondary: #9ca3af;
    --border-glass: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-glow: 0 0 40px rgba(168, 85, 247, 0.15);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============ LOGIN SCREEN ============ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, rgba(168, 85, 247, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 60%),
        var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.login-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: twinkle var(--duration, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}

.star.big {
    width: 5px;
    height: 5px;
    background: rgba(168, 85, 247, 0.7);
}

@keyframes twinkle {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 50px 40px;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow), 0 25px 60px rgba(0, 0, 0, 0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-logo h1 span {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.35);
}

.login-help {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 20px;
}

.login-help a {
    color: var(--accent-1);
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

/* ============ SYSTEM HEADER ============ */
.sys-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 22px;
}

.header-brand h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.header-brand h2 span {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-glass);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    border-color: var(--accent-2);
    color: var(--accent-2);
}

/* ============ SYSTEM HERO ============ */
.sys-hero {
    position: relative;
    padding: 60px 0 40px;
    text-align: center;
    overflow: hidden;
}

.hero-glow-1,
.hero-glow-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.hero-glow-1 {
    width: 400px;
    height: 400px;
    background: rgba(168, 85, 247, 0.12);
    top: -100px;
    left: 10%;
}

.hero-glow-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.08);
    bottom: -50px;
    right: 15%;
}

.sys-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.sys-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============ GENERATOR ============ */
.generator-section {
    padding: 20px 0 60px;
}

.gen-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.gen-header {
    padding: 24px 30px;
    border-bottom: 1px solid var(--border-glass);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.05));
}

.gen-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.gen-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-group select:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.form-group select option {
    background: #1a1a2e;
    color: #fff;
}

.form-group select optgroup {
    background: #12121f;
    color: #ec4899;
    font-weight: 700;
    font-style: normal;
    font-size: 0.85rem;
    padding: 6px 0;
    letter-spacing: 0.5px;
}

.form-group select optgroup option {
    background: #1a1a2e;
    color: #e0e0e5;
    font-weight: 400;
    padding-left: 12px;
}

.gen-actions {
    text-align: center;
    padding-top: 10px;
}

.btn-generate {
    padding: 18px 50px;
    background: var(--gradient-btn);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.4);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* ============ PREVIEW ============ */
.preview-section {
    margin-top: 30px;
}

.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.preview-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.preview-info span {
    font-size: 0.82rem;
    color: var(--accent-1);
    background: rgba(168, 85, 247, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.preview-table-wrap {
    overflow-x: auto;
    padding: 0;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.preview-table th {
    background: rgba(168, 85, 247, 0.1);
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-1);
    border-bottom: 2px solid rgba(168, 85, 247, 0.2);
    white-space: nowrap;
}

.preview-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
    color: var(--text-secondary);
}

.preview-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.preview-note {
    text-align: center;
    padding: 14px;
}

.preview-note p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.edit-hint {
    color: var(--accent-1) !important;
    margin-top: 6px;
}

.editable-cell {
    cursor: text;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: normal !important;
    min-width: 200px;
    max-width: 400px;
}

.editable-cell:hover {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.05) !important;
}

.editable-cell:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
    background: rgba(168, 85, 247, 0.08) !important;
    color: var(--text-primary);
}

.download-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 20px 30px 30px;
}

.btn-download {
    padding: 14px 36px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-csv {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-xlsx {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ============ INFO CARDS ============ */
.info-section {
    padding: 60px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.1);
}

.info-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============ FOOTER ============ */
.sys-footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-glass);
}

.sys-footer p {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sys-hero h1 {
        font-size: 1.6rem;
    }

    .login-card {
        margin: 20px;
        padding: 36px 24px;
        flex-direction: column !important;
        max-width: 100% !important;
    }

    .login-image {
        flex: none !important;
    }

    .download-actions {
        flex-direction: column;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }

    .gen-form {
        padding: 20px;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .header-brand h2 {
        font-size: 0.9rem;
    }

    .user-name {
        display: none;
    }
}