/* ═══════════════════════════════════════════
   Twilio Call Tool — Dark Purple / Hologram Theme
   ═══════════════════════════════════════════ */

:root {
    --bg-primary: #0a0512;
    --bg-secondary: #0f0a1e;
    --bg-card: rgba(18, 8, 40, 0.65);
    --bg-card-hover: rgba(26, 14, 54, 0.8);

    --accent: #7c3aed;
    --accent-bright: #a78bfa;
    --accent-dark: #5b21b6;
    --accent-glow: rgba(124, 58, 237, 0.15);

    --green: #22c55e;
    --green-dim: rgba(34, 197, 94, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --amber: #f59e0b;

    --text-primary: #e2dff0;
    --text-secondary: #a898c8;
    --text-muted: #605078;
    --text-accent: var(--accent-bright);

    --border-card: rgba(124, 58, 237, 0.12);
    --border-input: rgba(124, 58, 237, 0.2);
    --border-input-focus: rgba(124, 58, 237, 0.5);

    --radius: 12px;
    --radius-lg: 20px;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 5, 18, 0.7) 100%);
    pointer-events: none;
    z-index: 0;
}

main {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    padding: 40px 20px 60px;
}

/* ═══ Hero ═══ */

.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hero .accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ═══ Card ═══ */

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    transition: background 0.3s;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-icon {
    font-size: 1.3rem;
}

/* ═══ Form ═══ */

.form-field {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.required {
    color: var(--accent-bright);
}

input[type="tel"],
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-input);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input[type="tel"]:focus,
textarea:focus {
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="tel"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══ Checkboxes ═══ */

.form-options {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.15);
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--accent-glow);
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-text {
    line-height: 1.4;
}

/* ═══ Button ═══ */

.btn-call {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px var(--accent-glow);
    font-family: var(--font);
}

.btn-call:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.btn-call:active:not(:disabled) {
    transform: translateY(0);
}

.btn-call:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
}

/* ═══ Result ═══ */

.form-result {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    min-height: 1.5em;
}

.form-result.success {
    color: var(--green);
}

.form-result.error {
    color: var(--red);
}

/* ═══ History ═══ */

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-item .phone {
    color: var(--text-primary);
    font-family: monospace;
}

.history-item .status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.history-item .status.completed {
    background: var(--green-dim);
    color: var(--green);
}

.history-item .status.failed {
    background: var(--red-dim);
    color: var(--red);
}

/* ═══ Toast ═══ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══ Footer ═══ */

footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ═══ Responsive ═══ */

@media (max-width: 600px) {
    main {
        padding: 24px 16px 40px;
    }

    .card {
        padding: 20px 16px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }
}
