/* ───────────────────────────────────────────
   Email Automation Workflow — Premium Dark UI
   ─────────────────────────────────────────── */

/* ── Reset & Variables ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-card: rgba(15, 20, 40, 0.65);
    --bg-card-hover: rgba(20, 28, 55, 0.75);
    --border-card: rgba(99, 102, 241, 0.15);
    --border-glow: rgba(99, 102, 241, 0.35);

    --text-primary: #e8eaf6;
    --text-secondary: #8890b5;
    --text-muted: #5c6391;

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);

    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.12);
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── Background Glows ── */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}
.bg-glow-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent);
    top: -100px; left: -100px;
    animation: float-glow 18s ease-in-out infinite alternate;
}
.bg-glow-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent);
    bottom: 100px; right: -80px;
    animation: float-glow 22s ease-in-out infinite alternate-reverse;
}
.bg-glow-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.15), transparent);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: float-glow 15s ease-in-out infinite alternate;
}

@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.1); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-card);
    padding: 0 24px;
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    width: 42px; height: 42px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-sm);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header-badge {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-light);
    background: var(--accent-glow);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── Main ── */
.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    position: relative;
    z-index: 1;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    animation: card-enter 0.5s ease-out both;
}
.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow), var(--shadow-glow);
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Upload Toggle ── */
.upload-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}
.upload-toggle {
    display: flex;
    background: rgba(15, 20, 40, 0.6);
    padding: 6px;
    border-radius: 40px;
    border: 1px solid var(--border-card);
    gap: 4px;
}
.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle-btn:hover {
    color: var(--text-primary);
}
.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ── Manual Entry ── */
.manual-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 32px;
    font-size: 0.85rem;
    color: var(--text-primary);
    animation: card-enter 0.3s ease-out both;
}
.contact-chip-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px;
    display: grid;
    place-items: center;
}
.contact-chip-remove:hover {
    color: var(--error);
}

/* ── Step Header ── */
.step-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.step-number {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px var(--accent-glow);
}
.step-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}
.step-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.step-desc strong {
    color: var(--accent-light);
}

/* ── Upload Zone ── */
.upload-zone {
    border: 2px dashed rgba(99, 102, 241, 0.25);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(99, 102, 241, 0.03);
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 0 0 40px rgba(99, 102, 241, 0.06);
}
.upload-zone.drag-over {
    transform: scale(1.01);
}
.upload-icon {
    color: var(--accent-light);
    margin-bottom: 12px;
    animation: bounce-soft 2s ease-in-out infinite;
}
@keyframes bounce-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.upload-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.upload-subtext {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ── Contacts Info ── */
.contacts-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--success-bg);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: var(--radius-sm);
}
.info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}
.info-badge span {
    font-size: 1.2rem;
    font-weight: 800;
}

/* ── Table ── */
.table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
th {
    background: rgba(99, 102, 241, 0.08);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--accent-light);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}
td {
    padding: 10px 14px;
    border-top: 1px solid rgba(99, 102, 241, 0.06);
    color: var(--text-secondary);
    white-space: nowrap;
}
tr:hover td {
    background: rgba(99, 102, 241, 0.04);
    color: var(--text-primary);
}

/* ── Template Grid ── */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.template-card {
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
    background: rgba(15, 20, 40, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}
.template-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.06);
    transform: translateY(-2px);
}
.template-card.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
}
.template-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px; right: 14px;
    width: 22px; height: 22px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}
.template-card h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.template-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── Subject Input ── */
.subject-wrap {
    margin-bottom: 24px;
}
.subject-wrap label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.label-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}
.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.2);
    background-color: var(--bg-primary);
}
.input::placeholder {
    color: var(--text-muted);
}
.input-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.input-hint code {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--accent-light);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-send {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.25);
    padding: 14px 32px;
    font-size: 0.95rem;
}
.btn-send:hover {
    box-shadow: 0 6px 30px rgba(52, 211, 153, 0.35);
    transform: translateY(-1px);
}
.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: transparent;
    color: var(--error);
    border: 1px solid rgba(248, 113, 113, 0.2);
    padding: 6px 14px;
    font-size: 0.8rem;
}
.btn-ghost:hover {
    background: var(--error-bg);
    border-color: rgba(248, 113, 113, 0.4);
}

/* ── Preview Cards ── */
.preview-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}
.preview-list::-webkit-scrollbar {
    width: 5px;
}
.preview-list::-webkit-scrollbar-track {
    background: transparent;
}
.preview-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

.preview-card {
    padding: 20px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-card);
    background: rgba(15, 20, 40, 0.5);
    animation: card-enter 0.4s ease-out both;
}
.preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}
.preview-to {
    font-weight: 600;
    font-size: 0.92rem;
}
.preview-to span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.82rem;
    margin-left: 8px;
}
.preview-subject {
    font-size: 0.82rem;
    color: var(--accent-light);
    font-weight: 500;
}
.preview-body {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 120px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s ease;
}
.preview-body.expanded {
    max-height: 2000px;
}
.preview-toggle {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--accent-light);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}
.preview-toggle:hover {
    color: var(--accent);
}

/* ── Send Bar ── */
.send-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(15, 20, 40, 0.6);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
}
.send-stats {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Results ── */
.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    margin-bottom: 8px;
    font-size: 0.88rem;
    animation: card-enter 0.3s ease-out both;
}
.result-item.sent {
    background: var(--success-bg);
    border: 1px solid rgba(52, 211, 153, 0.15);
}
.result-item.failed {
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.15);
}
.result-icon {
    width: 28px; height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.result-item.sent .result-icon {
    background: rgba(52, 211, 153, 0.2);
    color: var(--success);
}
.result-item.failed .result-icon {
    background: rgba(248, 113, 113, 0.2);
    color: var(--error);
}
.result-name {
    font-weight: 600;
}
.result-email {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── Summary Banner ── */
.results-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-sm);
}
.summary-stat {
    text-align: center;
    flex: 1;
}
.summary-stat .stat-val {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}
.summary-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.stat-sent .stat-val { color: var(--success); }
.stat-failed .stat-val { color: var(--error); }

/* ── Toast ── */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    animation: toast-in 0.35s ease-out;
    min-width: 280px;
    box-shadow: var(--shadow);
}
.toast.success {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: var(--success);
}
.toast.error {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: var(--error);
}
.toast.info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--accent-light);
}
.toast-exit {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ── Loading Spinner ── */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sender Form ── */
.sender-form { margin-bottom: 20px; }
.sender-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238890b5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.select:hover {
    border-color: var(--accent-light);
    background-color: rgba(99, 102, 241, 0.05);
}

.select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 8px 24px rgba(0, 0, 0, 0.2);
    background-color: var(--bg-primary);
}

/* Style the dropdown options */
.select option {
    background-color: #1a1f35;
    color: var(--text-primary);
    padding: 12px;
}

.password-wrap {
    position: relative;
}
.password-wrap .input { padding-right: 42px; }
.eye-toggle {
    position: absolute;
    right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px;
    transition: color 0.2s;
}
.eye-toggle:hover { color: var(--accent-light); }
.sender-select-wrap {
    margin-bottom: 20px;
}
.sender-select-wrap label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* ── Verified Senders ── */
.verified-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 10px;
}
.sender-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    animation: card-enter 0.3s ease-out both;
}
.sender-chip-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sender-chip-avatar {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border-radius: 50%;
    font-weight: 700; font-size: 0.85rem;
}
.sender-chip-name { font-weight: 600; font-size: 0.88rem; }
.sender-chip-email { font-size: 0.78rem; color: var(--text-muted); }
.sender-chip-badge {
    font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--success);
    background: rgba(52, 211, 153, 0.12);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.2);
}
.sender-chip-remove {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    padding: 4px; margin-left: 8px;
    transition: color 0.2s;
}
.sender-chip-remove:hover { color: var(--error); }

/* ── OTP Modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: grid; place-items: center;
    animation: fade-in 0.25s ease-out;
}
.modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius);
    padding: 32px;
    width: 90%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--shadow-glow);
    text-align: center;
    animation: card-enter 0.3s ease-out;
}
.modal-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.modal-header h3 { font-size: 1.15rem; font-weight: 700; }
.modal-close {
    background: none; border: none;
    color: var(--text-muted); font-size: 1.5rem;
    cursor: pointer; padding: 0 4px;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--error); }
.modal-desc {
    font-size: 0.85rem; color: var(--text-secondary);
    margin-bottom: 24px; text-align: left;
}
.modal-desc strong { color: var(--accent-light); }
.otp-input-group {
    display: flex; gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}
.otp-digit {
    width: 48px; height: 56px;
    text-align: center;
    font-family: var(--font);
    font-size: 1.4rem; font-weight: 700;
    background: rgba(15, 20, 40, 0.8);
    border: 2px solid var(--border-card);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: var(--accent);
}
.otp-digit:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.modal-verify-btn { width: 100%; justify-content: center; }
.otp-resend {
    margin-top: 16px; font-size: 0.8rem;
    color: var(--text-muted);
}
.link {
    color: var(--accent-light);
    cursor: pointer; font-weight: 500;
    transition: color 0.2s;
}
.link:hover { color: var(--accent); text-decoration: underline; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.step-number-success {
    background: linear-gradient(135deg, #10b981, #34d399) !important;
}

/* ── Toggle Switch ── */
.resume-section { margin-bottom: 20px; }
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(15, 20, 40, 0.5);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.toggle-label {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer; color: var(--text-primary);
}
.toggle-label svg { color: var(--accent-light); }
.toggle-switch {
    position: relative;
    width: 48px; height: 26px;
    display: inline-block;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--border-card);
    border-radius: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    left: 3px; bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}
.toggle-switch input:checked + .toggle-slider {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(21px);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ── Resume Upload ── */
.resume-upload-area {
    animation: card-enter 0.3s ease-out;
}
.resume-dropzone {
    border: 2px dashed rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(99, 102, 241, 0.02);
    color: var(--accent-light);
}
.resume-dropzone:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
}
.resume-drop-text {
    font-size: 0.9rem; font-weight: 600;
    color: var(--text-primary); margin-top: 8px;
}
.resume-drop-sub {
    font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
}
.resume-file-info {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-sm);
    animation: card-enter 0.3s ease-out;
}
.resume-file-chip {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem; font-weight: 500;
    color: var(--accent-light);
}
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }
/* ── Footer ── */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.78rem;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

/* ── Login Card ── */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 48px 40px 40px;
    width: 100%;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow), var(--shadow-glow);
    text-align: center;
    animation: login-card-enter 0.7s ease-out both;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), #8b5cf6, transparent);
    animation: shimmer-line 3s ease-in-out infinite;
}

@keyframes login-card-enter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer-line {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

/* ── Login Card Success State ── */
.login-card.login-success {
    border-color: var(--success);
    box-shadow: 0 0 60px rgba(52, 211, 153, 0.2), var(--shadow);
    transform: scale(0.97);
}

/* ── Login Logo ── */
.login-logo {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}
.login-logo-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-radius: 20px;
    color: #fff;
    box-shadow: 0 8px 32px var(--accent-glow);
    position: relative;
    z-index: 1;
    animation: logo-float 3s ease-in-out infinite alternate;
}
.login-logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    animation: logo-pulse 2s ease-in-out infinite;
    opacity: 0;
    z-index: 0;
}

@keyframes logo-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}
@keyframes logo-pulse {
    0% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

/* ── Login Text ── */
.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* ── Login Form ── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}

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

.login-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-submit-btn {
    width: 100%;
    margin-top: 8px;
    justify-content: center;
}

.login-toggle-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent-light);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: var(--font);
    font-size: 0.88rem;
    transition: color 0.2s;
}

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

/* ── Login Divider ── */
.login-divider {
    position: relative;
    margin-bottom: 28px;
}
.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-card);
}
.login-divider span {
    position: relative;
    background: var(--bg-primary);
    padding: 0 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* ── Google Sign-In Button ── */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}
.google-signin-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.08), rgba(234, 67, 53, 0.08), rgba(251, 188, 5, 0.08), rgba(52, 168, 83, 0.08));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.google-signin-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.google-signin-btn:hover::before {
    opacity: 1;
}
.google-signin-btn:active {
    transform: scale(0.98) translateY(0);
}
.google-icon {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.google-signin-btn span {
    position: relative;
    z-index: 1;
}

/* ── Login Loading ── */
.login-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}
.login-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(99, 102, 241, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.login-loading p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Login Hint ── */
.login-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.login-hint svg {
    flex-shrink: 0;
    color: var(--accent-light);
}

/* ── Login Error ── */
.login-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-xs);
    color: var(--error);
    font-size: 0.82rem;
    font-weight: 500;
    animation: card-enter 0.3s ease-out;
}
.login-error svg {
    flex-shrink: 0;
}

/* ── Login Footer ── */
.login-footer {
    margin-top: 32px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Floating Particles ── */
.login-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    animation: particle-drift linear infinite;
}

@keyframes particle-drift {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(40px);
    }
}

/* ═══════════════════════════════════════════════
   HEADER — USER PROFILE & LOGOUT
   ═══════════════════════════════════════════════ */

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

/* ── User Chip ── */
.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 4px 4px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 32px;
    transition: all 0.25s ease;
}
.user-chip:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.25);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.user-avatar-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Logout Button ── */
.btn-logout {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.12);
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}
.btn-logout:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--error);
    transform: scale(1.05);
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .main { padding: 24px 16px 60px; }
    .header-inner { padding: 0; }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
    .card { padding: 24px; }
}

@media (max-width: 768px) {
    .template-grid { grid-template-columns: 1fr; }
    .sender-form-row { grid-template-columns: 1fr; gap: 16px; }
    .login-container { max-width: 100%; }
    .logo h1 { font-size: 1.1rem; }
    .user-name { display: none; }
    .user-chip { padding: 4px; }
}

@media (max-width: 480px) {
    .card { padding: 20px 16px; }
    .step-header { gap: 12px; }
    .step-number { width: 32px; height: 32px; font-size: 0.95rem; }
    .step-header h2 { font-size: 1.15rem; }
    
    .upload-toggle { width: 100%; }
    .toggle-btn { flex: 1; justify-content: center; padding: 10px 12px; font-size: 0.85rem; }
    
    .otp-digit { width: 36px; height: 44px; font-size: 1rem; }
    .login-card { padding: 32px 20px; }
    .login-title { font-size: 1.5rem; }
    
    .send-bar { flex-direction: column; align-items: stretch; gap: 16px; }
    .btn-send { width: 100%; justify-content: center; }
    
    .contact-chip { width: 100%; justify-content: space-between; }
}
