/* UI/UX Pro Max Rules: 
   - Base 16px body, 1.5 line height 
   - 44px min touch targets
   - Distinct focus states
   - Accessible contrast colors
   - Mobile-first approach
*/

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --surface: #ffffff;
    --background: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --focus-ring: rgba(37, 99, 235, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--background);
    line-height: 1.5;
    font-size: 16px;
    padding: 16px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
}

header p {
    color: var(--text-muted);
    font-size: 14px;
}

.card {
    background-color: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

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

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

input {
    width: 100%;
    min-height: 44px; /* Essential touch target size */
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px; /* Prevents auto-zoom on mobile */
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.error-msg {
    display: block;
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

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

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
    width: auto;
}

.btn-text {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.search-bar {
    margin-bottom: 16px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #fafafa;
}

.contact-info strong {
    display: block;
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.contact-info span {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
}

.contact-actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 0;
}

@media (min-width: 480px) {
    .contact-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .contact-actions {
        flex-direction: row;
    }
}
