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

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #14141f;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --success: #22c55e;
    --danger: #ef4444;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #27273a;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 100px 20px;
    text-align: center;
}

.login-container h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-secondary:hover {
    color: var(--text);
}

.error-msg {
    color: var(--danger);
    margin-top: 1rem;
}

/* Main Screen */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

header h2 {
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#user-email {
    color: var(--text-muted);
}

main {
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.panel {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1rem;
}

.panel h3 {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.status {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
}

.status.connected {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.hidden {
    display: none !important;
}

.current-ext {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.current-ext strong {
    color: var(--success);
    font-size: 1.2rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-left: auto;
}

#dial-input {
    width: 100%;
    font-size: 2rem;
    text-align: center;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dial-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.5rem;
    padding: 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dial-btn span {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.dial-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.dial-btn:active {
    transform: scale(0.95);
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-call {
    background: var(--success);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-call:hover {
    transform: scale(1.05);
}

.btn-hangup {
    background: var(--danger);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.call-status {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.call-status.active {
    color: var(--success);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#caller-id {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-answer {
    background: var(--success);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-reject {
    background: var(--danger);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
}
