﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Header fijo similar a la página principal */
.header-mini {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo-mini {
    height: 40px;
    width: auto;
}

.btn-volver {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.3);
}

    .btn-volver:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
        color: white;
        text-decoration: none;
    }

.registro-container {
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    animation: slideUp 0.6s ease;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

    .registro-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(45deg, #667eea, #764ba2);
    }

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    height: 60px;
    margin-bottom: 20px;
}

.titulo {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitulo {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

    .form-group label {
        display: block;
        color: #333;
        font-weight: 600;
        margin-bottom: 8px;
        font-size: 1rem;
    }

.required {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
}

    .form-control:focus {
        outline: none;
        border-color: #667eea;
        background: white;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        transform: translateY(-2px);
    }

    .form-control.error {
        border-color: #dc3545;
        background: #fff5f5;
    }

    .form-control.valido {
        border-color: #28a745;
        background: #f8fff9;
    }

    .form-control.invalido {
        border-color: #dc3545;
        background: #fff5f5;
    }

    .form-control.validando {
        border-color: #ffc107;
        background: #fffdf0;
    }

.codigo-status, .usuario-status, .password-status {
    margin-top: 8px;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    transition: all 0.3s ease;
}

    .codigo-status.validando, .usuario-status.validando, .password-status.validando {
        background: #fff3cd;
        border: 1px solid #ffeaa7;
        color: #856404;
        display: block;
        animation: pulse 1.5s infinite;
    }

    .codigo-status.valido, .usuario-status.valido, .password-status.valido {
        background: #d4edda;
        border: 1px solid #c3e6cb;
        color: #155724;
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .codigo-status.invalido, .usuario-status.invalido, .password-status.invalido {
        background: #f8d7da;
        border: 1px solid #f5c6cb;
        color: #721c24;
        display: block;
        animation: fadeIn 0.3s ease;
    }

.text-danger {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

.btn-container {
    text-align: center;
    margin-top: 30px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    margin-right: 15px;
    position: relative;
    overflow: hidden;
}

    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
        transition: left 0.5s;
    }

    .btn-primary:hover::before {
        left: 100%;
    }

    .btn-primary:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    }

    .btn-primary:disabled {
        background: #6c757d;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

    .btn-secondary:hover {
        background: #5a6268;
        transform: translateY(-2px);
        color: white;
        text-decoration: none;
    }

.alert {
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideDown 0.5s ease;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 20px;
    margin: 20px 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.datos-generados {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border: 2px solid #28a745;
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    animation: slideUp 0.6s ease;
}

    .datos-generados h3 {
        color: #155724;
        font-size: 1.8rem;
        margin-bottom: 25px;
        background: linear-gradient(45deg, #28a745, #20c997);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

.datos-acceso {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.dato-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e1e5e9;
    font-size: 1.1rem;
}

    .dato-item:last-child {
        border-bottom: none;
    }

.codigo-cliente, .usuario, .password {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px 15px;
    border-radius: 10px;
    font-weight: bold;
    color: #667eea;
    border: 2px solid #dee2e6;
    letter-spacing: 1px;
}

.importante {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    color: #856404;
}

    .importante p {
        margin-bottom: 10px;
    }

        .importante p:last-child {
            margin-bottom: 0;
        }

/* Animaciones */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-mini {
        padding: 1rem 3%;
    }

    .logo-mini {
        height: 35px;
    }

    .btn-volver {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .registro-container {
        padding: 30px 20px;
        margin: 20px 10px;
        margin-top: 90px;
        border-radius: 20px;
    }

    .titulo {
        font-size: 1.8rem;
    }

    .subtitulo {
        font-size: 1rem;
    }

    .form-control {
        padding: 12px 15px;
        font-size: 16px; /* Evita zoom en iOS */
    }

    .btn-primary, .btn-secondary {
        padding: 12px 30px;
        font-size: 1rem;
        margin: 5px;
        width: 100%;
        max-width: 280px;
    }

    .btn-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .dato-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .codigo-cliente, .usuario, .password {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header-mini {
        padding: 0.8rem 2%;
    }

    .registro-container {
        padding: 25px 15px;
        margin: 15px 5px;
        margin-top: 85px;
    }

    .titulo {
        font-size: 1.6rem;
    }

    .subtitulo {
        font-size: 0.95rem;
    }

    .form-control {
        padding: 10px 12px;
    }

    .datos-generados {
        padding: 20px 15px;
    }

    .datos-acceso {
        padding: 20px 15px;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .registro-container {
        background: #1a1a1a;
        color: #fff;
    }

    .titulo {
        color: #fff;
    }

    .subtitulo {
        color: #ccc;
    }

    .form-control {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }

        .form-control:focus {
            background: #333;
        }
}
