/**
 * codigo.nubservices.com — Styles
 * Modern, clean, responsive design for Nub Services
 */

:root {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #6366f1;
    --info-light: #e0e7ff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
    --transition: all 0.2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.logo-text {
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-800);
}

.support-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.support-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* Main */
.main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px;
}

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    padding: 32px 28px;
    width: 100%;
    max-width: 480px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 28px;
}

/* Steps Progress */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary);
}

.step.completed .step-label {
    color: var(--success);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 8px;
    margin-bottom: 18px;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--gray-800);
    background: white;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group .hint {
    display: block;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    width: 100%;
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

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

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

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

.btn-outline:hover:not(:disabled) {
    background: var(--primary-light);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    width: auto;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Validated Badge */
.validated-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    color: #065f46;
}

.validated-badge svg {
    color: var(--success);
    flex-shrink: 0;
}

/* Result */
.result-container {
    margin-top: 20px;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.result-header {
    background: var(--primary-light);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

.result-status {
    font-size: 12px;
    font-weight: 600;
}

.status-active { color: var(--success); }
.status-warning { color: var(--warning); }
.status-expired { color: var(--danger); }

.result-body {
    padding: 16px;
}

.result-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 90px;
}

.result-value {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    color: var(--gray-400);
    transition: var(--transition);
    margin-left: 8px;
    flex-shrink: 0;
}

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

.copy-btn.copied {
    color: var(--success);
}

.result-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--warning-light);
    color: #92400e;
    font-size: 12px;
    border-top: 1px solid #fde68a;
}

.security-notice svg {
    flex-shrink: 0;
}

/* Messages */
.message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    animation: fadeIn 0.2s ease;
}

.message-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message-info {
    background: var(--info-light);
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

/* New Query */
.new-query {
    margin-top: 16px;
    text-align: center;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 16px;
    font-size: 12px;
    color: var(--gray-400);
}

.footer-link {
    margin-top: 4px;
}

.footer-link a {
    color: var(--primary);
    text-decoration: none;
}

.footer-link a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 520px) {
    .card {
        padding: 24px 20px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .main {
        padding: 16px 0;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-sm {
        width: 100%;
    }
}
