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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
}

.section {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.hidden {
    display: none !important;
}

/* Login Form */
#login-section h1 {
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 30px;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.error {
    color: #f44336;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    width: 100%;
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    background: #f5f5f5;
    color: #666;
}

.btn-small:hover {
    background: #e0e0e0;
}

/* Phone Header */
.phone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.user-info {
    display: flex;
    flex-direction: column;
}

#display-name {
    font-weight: 600;
    color: #333;
}

.extension {
    font-size: 12px;
    color: #666;
}

.status-indicator {
    flex: 1;
    text-align: center;
}

.status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.status.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.status.connecting {
    background: #fff3e0;
    color: #ef6c00;
}

.status.disconnected {
    background: #ffebee;
    color: #c62828;
}

/* Phone Display */
.phone-display {
    margin-bottom: 20px;
}

#dial-input {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    text-align: center;
    border: none;
    background: #f5f5f5;
    border-radius: 12px;
    letter-spacing: 2px;
}

#dial-input:focus {
    outline: none;
    background: #eeeeee;
}

.call-status {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    min-height: 20px;
}

.call-timer {
    text-align: center;
    font-size: 18px;
    color: #4CAF50;
    font-weight: 600;
    margin-top: 5px;
}

/* Dialpad */
.dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.dial-btn {
    aspect-ratio: 1.2;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dial-btn span {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
    letter-spacing: 1px;
}

.dial-btn:hover {
    background: #e0e0e0;
}

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

/* Call Controls */
.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-call {
    background: #4CAF50;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-direction: column;
    font-size: 12px;
}

.btn-call:hover {
    background: #45a049;
}

.btn-hangup {
    background: #f44336;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-direction: column;
    font-size: 12px;
}

.btn-hangup:hover {
    background: #d32f2f;
}

.btn-answer {
    background: #4CAF50;
    color: white;
    padding: 16px 32px;
}

.btn-mute {
    background: #757575;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-direction: column;
    font-size: 12px;
}

.btn-mute:hover {
    background: #616161;
}

.btn-mute.muted {
    background: #f44336;
}

.btn-mute.muted:hover {
    background: #d32f2f;
}

/* Incoming Call */
.incoming-call {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.incoming-caller {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.caller-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.caller-avatar svg {
    fill: white;
}

.caller-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#caller-name {
    font-size: 24px;
    font-weight: 600;
}

.incoming-label {
    color: rgba(255, 255, 255, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.incoming-actions {
    display: flex;
    gap: 40px;
}

.btn-reject {
    background: #f44336;
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

.btn-reject:hover {
    background: #d32f2f;
}

.btn-accept {
    background: #4CAF50;
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

.btn-accept:hover {
    background: #45a049;
}

/* Responsive */
@media (max-width: 420px) {
    .container {
        max-width: 100%;
    }

    .section {
        padding: 20px;
        border-radius: 0;
    }

    .dial-btn {
        font-size: 20px;
    }
}
