:root {
    --primary: #008cce; /* Azul semelhante ao do concorrente */
    --primary-dark: #0180bb;
    --secondary: #28a745; /* Verde para ações de sucesso/início */
    --secondary-dark: #218838;
    --bg-light: #f4f7f6;
    --text-dark: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
header {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--text-dark);
}

/* --- Main Container --- */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* --- View: Landing Page --- */
#landing-view {
    text-align: center;
    padding: 3rem 0;
    animation: fadeIn 0.5s ease;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.15);
}

.card-icon {
    width: 64px;
    height: 64px;
    background: #e6f0fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.card-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- View: Migration Tool --- */
#tool-view {
    display: none; /* Hidden by default */
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.tool-header {
    background: var(--primary);
    color: var(--white);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.tool-body {
    padding: 2rem;
}

/* Email Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    background: #f0f2f5;
    padding: 5px;
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 40px;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Grid for Source/Dest */
.migration-grid {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .migration-grid {
        grid-template-columns: 1fr;
    }
    .arrow-separator {
        transform: rotate(90deg);
        margin: 1rem auto;
    }
}

.col-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.arrow-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-light);
    padding-top: 2rem; /* Align with inputs */
}

/* Batch Upload Area */
#batch-area {
    display: none;
    margin-bottom: 2rem;
    text-align: center;
}

.drop-zone {
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 3rem;
    background: #f8fbff;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.drop-zone:hover, .drop-zone.dragover {
    background: #e6f0fa;
    border-color: var(--primary-dark);
}

.drop-zone-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.drop-zone-sub {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.download-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary);
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Actions Footer */
.tool-footer {
    background: #e9ecef;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-notify {
    background: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    margin-right: 1rem;
}

.btn-notify:hover {
    background: #f0f8ff;
}

.btn-start {
    background: var(--secondary);
    color: var(--white);
}

.btn-start:hover {
    background: var(--secondary-dark);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s ease;
    text-align: center;
}

.modal h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.modal p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-dark);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-left: 4px solid var(--secondary); }
.toast.info { border-left: 4px solid var(--primary); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Utility */
.hidden { display: none !important; }

/* Toggle Switch (SSL) */
.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(16px); }

/* --- LANDING & TOOL VIEW (Resumido para focar na nova tela) --- */
.card { background: var(--white); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center; cursor: pointer; transition: 0.3s; display: flex; width: 200px; margin: 10px; }
.card:hover { transform: translateY(-5px); border-color: var(--primary); }
.btn { padding: 0.8rem 1.5rem; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; background: var(--secondary); color: var(--white); }
.btn:hover { background-color: #218838; }
.hidden { display: none !important; }

/* =========================================
    NOVA TELA: STATUS DA MIGRAÇÃO
    ========================================= */

.status-container {
    display: flex; flex-direction: column; gap: 1.5rem;
}

/* Info Bar: Token & URL */
.info-bar {
    background: var(--white); padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
}

.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-light); font-weight: 700; letter-spacing: 0.5px; }
.info-value { font-family: 'Courier New', monospace; font-size: 1rem; color: var(--primary-dark); font-weight: 600; display: flex; align-items: center; gap: 10px; }

.copy-btn {
    background: #f0f2f5; border: 1px solid #ddd; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; color: #555; transition: 0.2s;
}
.copy-btn:hover { background: #e2e6ea; color: #000; }

.auto-update-badge {
    background: #e6f0fa; color: var(--primary); padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.spinner {
    width: 12px; height: 12px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Progress Section */
.progress-section { background: var(--white); padding: 1.5rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 600; }
.progress-track { height: 10px; background: #e9ecef; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--secondary), #34d058); transition: width 0.4s ease; }

/* Terminal Window */
.terminal-wrapper {
    background: #2d2d2d; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,0.3); font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.terminal-header {
    background: #3e3e3e; padding: 8px 15px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #444;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }
.terminal-title { margin-left: 10px; color: #999; font-size: 0.8rem; }

.terminal-body {
    background: var(--terminal-bg); color: var(--terminal-text); padding: 15px; height: 400px; overflow-y: auto; font-size: 0.9rem; line-height: 1.5;
}

/* Log Colors */
.log-line { margin-bottom: 2px; word-break: break-all; }
.log-time { color: #666; margin-right: 10px; user-select: none; }
.log-cmd { color: var(--terminal-green); font-weight: bold; }
.log-info { color: #d4d4d4; }
.log-warn { color: #ffbd2e; }
.log-error { color: #ff5f56; }
.log-highlight { color: var(--terminal-blue); }

/* Cursor blinking effect */
.cursor::after {
    content: '▋'; animation: blink 1s step-start infinite; color: var(--terminal-green); margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Action Bar */
.action-bar { text-align: right; margin-top: 10px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-dark); margin-right: 10px; }
.btn-outline:hover { background: #f8f9fa; }
.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #c82333; }

/* Steps (Origem/Destino) */
.steps { display: grid; gap: 8px; margin: 12px 0 }
.step { display: flex; align-items: center; gap: 10px; background:#fff; padding:10px 12px; border-radius:8px; box-shadow:var(--shadow) }
.step-icon { width: 12px; height: 12px; border-radius: 50%; background: #94a3b8 }
.step-text .step-title { font-weight: 600; color: #0f172a }
.step-text .step-sub { font-size: 12px; color: #64748b }
.step.step--running .step-icon { background:#f59e0b; animation:pulse 1.5s infinite }
.step.step--done .step-icon { background:#10b981 }
.step.step--pending .step-icon { background:#94a3b8 }
.step.step--failed .step-icon { background:#ef4444 }
@keyframes pulse { 0% { opacity: .6 } 50% { opacity: 1 } 100% { opacity: .6 } }

/* History (Home) */
.history-section { margin-top: 24px }
.history-filters { display:flex; gap:10px; align-items:center; margin-bottom:12px }
.history-list { display:grid; grid-template-columns: 1fr; gap:12px }
.history-empty { color:#64748b; font-size:.95rem }
.history-item {
    background: var(--white);
    padding: 14px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
}
.history-row { display:flex; justify-content:space-between; align-items:center; gap:10px }
.history-left { display:flex; align-items:center; gap:10px }
.history-icon {
    width: 34px; height:34px; border-radius:10px; background:#e6f0fa; color: var(--primary);
    display:grid; place-items:center; flex:0 0 auto;
}
.history-title { font-weight:700; color:#0f172a }
.history-token { font-family: 'Courier New', monospace; font-size:.9rem; color:#475569 }
.history-meta { display:flex; align-items:center; gap:8px; color:#64748b; font-size:.85rem }
.status-pill {
    padding:2px 8px; border-radius:999px; font-weight:700; font-size:.75rem; color:#fff;
}
.status-pill.is-running { background:#f59e0b }
.status-pill.is-pending { background:#64748b }
.status-pill.is-done { background:#10b981 }
.status-pill.is-failed { background:#ef4444 }
.status-pill.is-invalid { background:#6b7280 }
.btn-link {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-link:hover {
    background: #f0f8ff;
}

select {
    padding: 0.5rem;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: var(--transition);
}
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}
