:root {
    --zinc-950: #09090b;
    --zinc-900: #18181b;
    --zinc-800: #27272a;
    --zinc-700: #3f3f46;
    --zinc-600: #52525b;
    --zinc-500: #71717a;
    --zinc-400: #a1a1aa;
    --zinc-300: #d4d4d8;
    --zinc-200: #e4e4e7;
    --zinc-100: #f4f4f5;
    --zinc-50: #fafafa;
    
    --red-600: #dc2626;
    --red-500: #ef4444;
    --green-600: #16a34a;
    --green-500: #22c55e;
    --yellow-600: #ca8a04;
    --yellow-500: #eab308;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--zinc-950);
    color: var(--zinc-50);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    color: var(--zinc-50);
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.header p {
    color: var(--zinc-400);
    font-size: 1.125rem;
    font-weight: 400;
}

.card {
    background: var(--zinc-900);
    border: 1px solid var(--zinc-800);
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.status-card {
    background: var(--zinc-900);
    border: 1px solid var(--zinc-800);
    border-radius: 0.375rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.status-card.connected {
    background: var(--zinc-800);
    border-left: 4px solid var(--green-500);
    color: var(--zinc-50);
}

.status-card.disconnected {
    background: var(--zinc-800);
    border-left: 4px solid var(--red-500);
    color: var(--zinc-50);
}

.status-card.config {
    background: var(--zinc-800);
    border-left: 4px solid var(--yellow-500);
    color: var(--zinc-50);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--zinc-900);
    border: 1px solid var(--zinc-700);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-icon {
    font-size: 2rem;
    margin-right: 1rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--green-500);
    color: white;
}

.modal-icon.warning {
    background: var(--yellow-500);
}

.modal-icon.error {
    background: var(--red-500);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--zinc-50);
    margin: 0;
}

.modal-content {
    color: var(--zinc-300);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-steps {
    background: var(--zinc-800);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.modal-steps h4 {
    color: var(--zinc-200);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-steps ol {
    color: var(--zinc-300);
    padding-left: 1.25rem;
    margin: 0;
}

.modal-steps li {
    margin-bottom: 0.5rem;
}

.modal-steps code {
    background: var(--zinc-700);
    color: var(--zinc-200);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.countdown {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--zinc-800);
    border-radius: 0.5rem;
    color: var(--zinc-300);
    font-size: 0.875rem;
}

.countdown-timer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-500);
    display: block;
    margin: 0.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--zinc-800);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--green-500);
    transition: width 1s linear;
    border-radius: 2px;
}

/* Form Validation Styles */
.form-group.error input {
    border-color: var(--red-500);
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 0 1px var(--red-500);
}

.form-group.error input:focus {
    border-color: var(--red-500);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    outline: none;
}

.error-message {
    color: var(--red-500);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.25rem;
    opacity: 0;
    transform: translateY(-0.25rem);
    transition: all 0.2s ease;
    overflow: hidden;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.error-message::before {
    content: '⚠️';
    font-size: 0.875rem;
}

.form-group.success input {
    border-color: var(--green-500);
    background: rgba(34, 197, 94, 0.05);
}

.form-group.success input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    outline: none;
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--zinc-400);
}

.strength-bar {
    width: 100%;
    height: 3px;
    background: var(--zinc-700);
    border-radius: 2px;
    margin-top: 0.25rem;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-weak .strength-fill {
    background: var(--red-500);
    width: 25%;
}

.strength-fair .strength-fill {
    background: var(--yellow-500);
    width: 50%;
}

.strength-good .strength-fill {
    background: var(--green-500);
    width: 75%;
}

.strength-strong .strength-fill {
    background: var(--green-600);
    width: 100%;
}

.status-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.status-text {
    flex: 1;
}

.status-text > div:first-child {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--zinc-50);
}

.status-text > div:last-child {
    color: var(--zinc-400);
    line-height: 1.4;
    font-size: 0.875rem;
}

h2 {
    color: var(--zinc-50);
    margin-bottom: 1.25rem;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--zinc-300);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--zinc-700);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--zinc-800);
    color: var(--zinc-50);
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: var(--zinc-600);
    background: var(--zinc-800);
    box-shadow: 0 0 0 2px var(--zinc-800), 0 0 0 4px var(--zinc-700);
}

input[type="text"]::placeholder, input[type="password"]::placeholder {
    color: var(--zinc-500);
}

input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--zinc-600);
}

.advanced-settings {
    margin: 1.5rem 0;
    border: 1px solid var(--zinc-700);
    border-radius: 0.375rem;
    overflow: hidden;
    background: var(--zinc-900);
}

.advanced-settings summary {
    padding: 0.875rem;
    background: var(--zinc-800);
    cursor: pointer;
    font-weight: 500;
    color: var(--zinc-300);
    user-select: none;
    transition: background-color 0.2s ease;
}

.advanced-settings summary:hover {
    background: var(--zinc-700);
}

.advanced-settings[open] summary {
    border-bottom: 1px solid var(--zinc-700);
}

.advanced-settings .form-group {
    margin: 20px 15px;
}

.advanced-settings .form-group:last-child {
    margin-bottom: 15px;
}

.btn {
    padding: 0.625rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1.25;
    min-height: 2.5rem;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--zinc-50);
    color: var(--zinc-900);
    border-color: var(--zinc-50);
}

.btn-primary:hover:not(:disabled) {
    background: var(--zinc-200);
    border-color: var(--zinc-200);
}

.btn-secondary {
    background: var(--zinc-700);
    color: var(--zinc-50);
    border-color: var(--zinc-700);
}

.btn-secondary:hover {
    background: var(--zinc-600);
    border-color: var(--zinc-600);
}

.btn-danger {
    background: var(--red-600);
    color: var(--zinc-50);
    border-color: var(--red-600);
}

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

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

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.button-group .btn {
    flex: 1;
    margin: 0;
}

.network-list {
    max-height: 18.75rem;
    overflow-y: auto;
    border: 1px solid var(--zinc-700);
    border-radius: 0.375rem;
    margin-top: 0.875rem;
    background: var(--zinc-800);
}

.network-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--zinc-700);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--zinc-50);
}

.network-item:last-child {
    border-bottom: none;
}

.network-item:hover {
    background: var(--zinc-700);
}

.network-item.selected {
    background: var(--zinc-600);
    color: var(--zinc-50);
}

.network-item > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.network-item a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    font-size: 0.875rem;
}

.network-item a:hover {
    color: var(--zinc-200);
}

/* tzapu WiFiManager signal quality system */
.q {
    height: 16px;
    margin: 0;
    padding: 0 5px;
    text-align: right;
    min-width: 38px;
    float: right;
}

.q.q-0:after { background-position-x: 0; }
.q.q-1:after { background-position-x: -16px; }
.q.q-2:after { background-position-x: -32px; }
.q.q-3:after { background-position-x: -48px; }
.q.q-4:after { background-position-x: -64px; }

.q.l:before { 
    background-position-x: -80px; 
    padding-right: 5px; 
}

.q:after, .q:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: 16px 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAQCAMAAADeZIrLAAAAJFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADHJj5lAAAAC3RSTlMAIjN3iJmqu8zd7vF8pzcAAABsSURBVHja7Y1BCsAwCASNSVo3/v+/BUEiXnIoXkoX5jAQMxTHzK9cVSnvDxwD8bFx8PhZ9q8FmghXBhqA1faxk92PsxvRc2CCCFdhQCbRkLoAQ3q/wWUBqG35ZxtVzW4Ed6LngPyBU2CobdIDQ5oPWI5nCUwAAAAASUVORK5CYII=');
}

/* 2x resolution support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .q:before, .q:after {
        background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALwAAAAgCAMAAACfM+KhAAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAESIzRGZ3iJmqu8zd7gKjCLQAAACmSURBVHgB7dDBCoMwEEXRmKlVY3L//3NLhyzqIqSUggy8uxnhCR5Mo8xLt+14aZ7wwgsvvPA/ofv9+44334UXXngvb6XsFhO/VoC2RsSv9J7x8BnYLW+AjT56ud/uePMdb7IP8Bsc/e7h8Cfk912ghsNXWPpDC4hvN+D1560A1QPORyh84VKLjjdvfPFm++i9EWq0348XXnjhhT+4dIbCW+WjZim9AKk4UZMnnCEuAAAAAElFTkSuQmCC');
        background-size: 95px 16px;
    }
}

.signal-quality {
    font-size: 0.75rem;
    color: var(--zinc-400);
}

.loading, .error, .no-networks {
    text-align: center;
    padding: 1.875rem;
    color: var(--zinc-400);
    font-style: italic;
    font-size: 0.875rem;
}

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

.no-networks a {
    color: var(--zinc-300);
    text-decoration: underline;
}

@media (max-width: 768px) {
    body {
        padding: 0.625rem;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 1.875rem;
    }
    
    .card, .status-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .status-card {
        flex-direction: column;
        text-align: center;
    }
    
    .status-icon {
        margin-right: 0;
        margin-bottom: 0.625rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .card, .status-card {
        padding: 1rem;
    }
    
    .network-item {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
    }
}