/* StitchRenderer — estilos base (patrón Google Stitch) */

:root {
    --stitch-primary: #6366f1;
    --stitch-primary-hover: #4f46e5;
    --stitch-primary-light: #eef2ff;
    --stitch-bg: #f8fafc;
    --stitch-surface: #ffffff;
    --stitch-text: #0f172a;
    --stitch-text-muted: #64748b;
    --stitch-border: #e2e8f0;
    --stitch-success: #16a34a;
    --stitch-error: #dc2626;
    --stitch-warning: #d97706;
    --stitch-radius: 14px;
    --stitch-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--stitch-bg);
    color: var(--stitch-text);
    line-height: 1.5;
    overflow-x: hidden;
}

.stitch-root {
    min-height: 100vh;
}

.stitch-split-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.stitch-brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--stitch-primary) 0%, var(--stitch-primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stitch-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
}

.stitch-brand-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    text-align: center;
}

.stitch-logo-wrap {
    margin-bottom: 48px;
}

.stitch-logo-circle {
    width: 112px;
    height: 112px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.stitch-logo-image {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
}

.stitch-logo-fallback {
    font-size: 48px;
}

.stitch-brand-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stitch-brand-subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.stitch-welcome {
    margin-bottom: 36px;
}

.stitch-welcome-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.stitch-welcome-text {
    font-size: 1rem;
    opacity: 0.92;
    line-height: 1.7;
}

.stitch-feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.stitch-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

.stitch-feature-icon {
    font-size: 1.25rem;
}

.stitch-feature-text {
    font-size: 0.95rem;
}

.stitch-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--stitch-bg);
}

.stitch-form-container {
    width: 100%;
    max-width: 440px;
    background: var(--stitch-surface);
    border-radius: var(--stitch-radius);
    box-shadow: var(--stitch-shadow);
    padding: 40px 36px;
    border: 1px solid var(--stitch-border);
}

.stitch-form-header {
    margin-bottom: 28px;
}

.stitch-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--stitch-text);
    margin-bottom: 6px;
}

.stitch-form-subtitle {
    color: var(--stitch-text-muted);
    font-size: 0.95rem;
}

.stitch-alert {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.stitch-alert.error {
    background: #fef2f2;
    color: var(--stitch-error);
    border: 1px solid #fecaca;
}

.stitch-alert.success {
    background: #f0fdf4;
    color: var(--stitch-success);
    border: 1px solid #bbf7d0;
}

.stitch-alert.warning {
    background: #fffbeb;
    color: var(--stitch-warning);
    border: 1px solid #fde68a;
}

.stitch-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stitch-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stitch-field-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--stitch-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stitch-field-icon {
    font-size: 1rem;
}

.stitch-input,
.stitch-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--stitch-border);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--stitch-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.stitch-field-error {
    font-size: 0.8rem;
    color: var(--stitch-error);
    min-height: 18px;
}

.stitch-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.stitch-checkbox-label {
    font-size: 0.85rem;
    color: var(--stitch-text-muted);
    cursor: pointer;
}

.stitch-submit {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--stitch-primary), var(--stitch-primary-hover));
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.stitch-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.stitch-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.stitch-submit-loader {
    display: inline-flex;
    align-items: center;
}

.stitch-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: stitch-spin 0.8s linear infinite;
}

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

.stitch-form-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--stitch-border);
    text-align: center;
}

.stitch-footer-text {
    font-size: 0.85rem;
    color: var(--stitch-text-muted);
}

/* Modal caja (login cajero) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--stitch-surface);
    border-radius: var(--stitch-radius);
    box-shadow: var(--stitch-shadow);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--stitch-border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-body {
    padding: 24px;
}

@media (max-width: 900px) {
    .stitch-split-layout {
        flex-direction: column;
    }

    .stitch-brand-panel {
        min-height: auto;
        padding: 36px 24px;
    }

    .stitch-logo-wrap {
        margin-bottom: 28px;
    }

    .stitch-welcome,
    .stitch-feature-list {
        display: none;
    }
}

@media (max-width: 480px) {
    .stitch-form-container {
        padding: 28px 20px;
    }
}
