* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 650px;
}

.form-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    transition: transform 0.3s ease;
}

.form-card:hover {
    transform: translateY(-5px);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #555;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
}

/* FIXED: Phone input with +1 prefix — no overlap */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.country-code {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #555;
    font-weight: 500;
    font-size: 16px;
    background: #f5f5f5;
    border-right: 2px solid #e0e0e0;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.input-wrapper input {
    flex: 1;
    padding: 12px 12px;
    border: none;
    outline: none;
    font-size: 16px;
    background: white;
    min-width: 0;
}

.input-wrapper input:focus {
    outline: none;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.hint {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result-container {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease;
    width: 100%;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h3 {
    color: #333;
    font-size: 18px;
}

.close-result {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.close-result:hover {
    color: #333;
}

.result-content {
    color: #555;
    line-height: 1.6;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.result-success {
    width: 100%;
}

.result-error {
    width: 100%;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    gap: 10px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
    flex-shrink: 0;
}

.result-value {
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    max-width: 100%;
}

.sip-address {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    background: #e3f2fd;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #2196F3;
    margin-top: 15px;
    width: 100%;
}

.phone-number-display {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    background: #e8f5e9;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #4CAF50;
    margin-top: 15px;
    width: 100%;
}

details {
    margin-top: 15px;
    width: 100%;
}

summary {
    cursor: pointer;
    color: #666;
    font-size: 13px;
    user-select: none;
}

summary:hover {
    color: #333;
}

pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 11px;
    overflow-x: auto;
    max-height: 300px;
    width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

@media (max-width: 700px) {
    .container {
        max-width: 100%;
    }

    .form-card {
        padding: 25px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .header h1 {
        font-size: 24px;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .result-label {
        min-width: auto;
    }

    .result-value {
        text-align: left;
        width: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}