/* =========================================================================
   AMP 2008 - Portal del Socio
   Paleta basada en el logo (violeta + celeste)
   Mobile-first, profesional
   ========================================================================= */

:root {
    /* Brand colors */
    --amp-primary:        #7B3F8F;
    --amp-primary-dark:   #6B2D7E;
    --amp-primary-light:  #F3E8F7;
    --amp-accent:         #2E9DD9;
    --amp-accent-dark:    #1C7FB8;
    --amp-accent-light:   #E6F4FB;

    /* Estados */
    --amp-success:        #3B6D11;
    --amp-success-light:  #EAF3DE;
    --amp-warning:        #BA7517;
    --amp-warning-light:  #FAEEDA;
    --amp-danger:         #A32D2D;
    --amp-danger-light:   #FCEBEB;

    /* Neutros */
    --amp-text:           #2C2C2A;
    --amp-text-muted:     #5F5E5A;
    --amp-text-tertiary:  #888780;
    --amp-border:         #E5E5E0;
    --amp-bg:             #F5F5F2;
    --amp-card:           #FFFFFF;

    /* Radios */
    --amp-radius-sm:      8px;
    --amp-radius-md:      12px;
    --amp-radius-lg:      16px;

    /* Sombras */
    --amp-shadow-sm:      0 1px 2px rgba(0,0,0,0.04);
    --amp-shadow-md:      0 2px 8px rgba(0,0,0,0.06);
}

/* Reset y base */
.portal-asociado * {
    box-sizing: border-box;
}

.portal-asociado {
    background: var(--amp-bg);
    color: var(--amp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Header con identidad violeta */
.portal-header {
    background: linear-gradient(135deg, var(--amp-primary) 0%, var(--amp-primary-dark) 100%);
    color: white;
    padding: 1.25rem 1rem 1rem;
}

.portal-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.portal-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-header-logo {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 10px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.portal-header-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.portal-header-titles {
    line-height: 1.2;
}

.portal-header-titles .name {
    font-size: 11px;
    opacity: 0.85;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.portal-header-titles .subtitle {
    font-size: 15px;
    font-weight: 600;
}

.portal-header-actions a,
.portal-header-actions button {
    color: white;
    text-decoration: none;
    background: transparent;
    border: 0;
    font-size: 22px;
    opacity: 0.85;
    cursor: pointer;
}

.portal-header-actions a:hover {
    opacity: 1;
}

.portal-welcome {
    margin-top: 0.75rem;
}

.portal-welcome .greeting {
    font-size: 12px;
    opacity: 0.85;
}

.portal-welcome .name {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.portal-welcome .meta {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

/* Container principal */
.portal-main {
    padding: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

/* Section title */
.portal-section-title {
    font-size: 11px;
    color: var(--amp-text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem;
    padding: 0 4px;
}

/* Card base */
.portal-card {
    background: var(--amp-card);
    border: 1px solid var(--amp-border);
    border-radius: var(--amp-radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.portal-card-clickable {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.15s, transform 0.05s;
}

.portal-card-clickable:hover {
    border-color: var(--amp-primary);
    color: inherit;
    text-decoration: none;
}

.portal-card-clickable:active {
    transform: scale(0.99);
}

/* Status banner */
.portal-status {
    border-radius: var(--amp-radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.portal-status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.portal-status.success {
    background: var(--amp-success-light);
    color: var(--amp-success);
}
.portal-status.success .portal-status-icon { background: var(--amp-success); }

.portal-status.warning {
    background: var(--amp-warning-light);
    color: var(--amp-warning);
}
.portal-status.warning .portal-status-icon { background: var(--amp-warning); }

.portal-status.danger {
    background: var(--amp-danger-light);
    color: var(--amp-danger);
}
.portal-status.danger .portal-status-icon { background: var(--amp-danger); }

.portal-status-content { flex: 1; }
.portal-status-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.portal-status-text {
    font-size: 14px;
    font-weight: 600;
}

/* Asistencia destacada */
.portal-asistencia-cta {
    display: block;
    background: var(--amp-accent-light);
    border: 1px solid var(--amp-accent);
    border-radius: var(--amp-radius-md);
    padding: 14px;
    margin-bottom: 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, transform 0.05s;
}

.portal-asistencia-cta:hover {
    background: #D1ECFA;
    color: inherit;
    text-decoration: none;
}

.portal-asistencia-cta:active { transform: scale(0.99); }

.portal-asistencia-cta-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-asistencia-cta-icon {
    width: 42px;
    height: 42px;
    background: var(--amp-accent);
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.portal-asistencia-cta-text { flex: 1; }
.portal-asistencia-cta-title {
    font-size: 15px;
    font-weight: 600;
    color: #0C4A6E;
    line-height: 1.2;
}
.portal-asistencia-cta-sub {
    font-size: 12px;
    color: var(--amp-accent-dark);
    margin-top: 2px;
}

.portal-asistencia-cta-chevron {
    color: var(--amp-accent-dark);
    font-size: 18px;
}

/* Grid de servicios 2x2 */
.portal-services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.portal-service-card {
    background: var(--amp-card);
    border: 1px solid var(--amp-border);
    border-radius: var(--amp-radius-md);
    padding: 16px 8px;
    text-decoration: none;
    color: var(--amp-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: border-color 0.15s, transform 0.05s;
    min-height: 110px;
}

.portal-service-card:hover {
    border-color: var(--amp-primary);
    color: var(--amp-text);
    text-decoration: none;
}

.portal-service-card:active { transform: scale(0.99); }

.portal-service-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 8px;
}

.portal-service-icon.purple {
    background: var(--amp-primary-light);
    color: var(--amp-primary);
}
.portal-service-icon.blue {
    background: var(--amp-accent-light);
    color: var(--amp-accent);
}
.portal-service-icon.green {
    background: var(--amp-success-light);
    color: var(--amp-success);
}

/* La card de telemedicina es un <button> (POST con SSO), no un <a>.
   Reseteamos los estilos nativos del button para que matchee a las cards. */
button.portal-service-card {
    font: inherit;
    width: 100%;
    cursor: pointer;
}

.portal-service-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.portal-service-sub {
    font-size: 11px;
    color: var(--amp-text-muted);
    margin-top: 2px;
}

/* Footer */
.portal-footer-contact {
    background: var(--amp-card);
    border: 1px solid var(--amp-border);
    border-radius: var(--amp-radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
}

.portal-footer-contact i {
    font-size: 20px;
    color: var(--amp-text-muted);
}

.portal-footer-contact .label {
    flex: 1;
    font-size: 12px;
    color: var(--amp-text-muted);
}

.portal-footer-contact a {
    font-size: 14px;
    font-weight: 600;
    color: var(--amp-primary);
    text-decoration: none;
}

.portal-footer {
    text-align: center;
    padding: 1rem;
    font-size: 11px;
    color: var(--amp-text-tertiary);
}

/* Botones del Portal */
.amp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--amp-radius-md);
    font-size: 15px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    min-height: 48px;
    transition: background 0.15s, transform 0.05s;
}

.amp-btn-primary {
    background: var(--amp-primary);
    color: white;
}
.amp-btn-primary:hover {
    background: var(--amp-primary-dark);
    color: white;
    text-decoration: none;
}
.amp-btn-primary:active { transform: scale(0.99); }

.amp-btn-accent {
    background: var(--amp-accent);
    color: white;
}
.amp-btn-accent:hover {
    background: var(--amp-accent-dark);
    color: white;
    text-decoration: none;
}
.amp-btn-accent:active { transform: scale(0.99); }

.amp-btn-danger {
    background: var(--amp-danger);
    color: white;
}
.amp-btn-danger:hover {
    background: #791F1F;
    color: white;
}

.amp-btn-outline {
    background: white;
    color: var(--amp-text);
    border: 1px solid var(--amp-border);
}
.amp-btn-outline:hover {
    border-color: var(--amp-primary);
    color: var(--amp-primary);
    text-decoration: none;
}

.amp-btn-block {
    display: flex;
    width: 100%;
}

/* Inputs */
.amp-input-group {
    margin-bottom: 1rem;
}

.amp-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--amp-text);
    margin-bottom: 6px;
}

.amp-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--amp-border);
    border-radius: var(--amp-radius-sm);
    font-size: 15px;
    color: var(--amp-text);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
}

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

.amp-input-error {
    border-color: var(--amp-danger);
}

.amp-help {
    font-size: 12px;
    color: var(--amp-text-muted);
    margin-top: 4px;
}

.amp-error {
    font-size: 12px;
    color: var(--amp-danger);
    margin-top: 4px;
}

/* Auth pages (Login, Registro, Recuperar) */
.amp-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--amp-bg);
}

.amp-auth-header {
    background: linear-gradient(135deg, var(--amp-primary) 0%, var(--amp-primary-dark) 100%);
    color: white;
    padding: 2rem 1rem 3rem;
    text-align: center;
}

.amp-auth-logo {
    width: 96px;
    height: 96px;
    background: white;
    border-radius: 24px;
    padding: 8px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.amp-auth-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.amp-auth-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}

.amp-auth-sub {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.amp-auth-card {
    background: white;
    border-radius: var(--amp-radius-lg);
    border: 1px solid var(--amp-border);
    padding: 1.5rem;
    margin: -2rem 1rem 1rem;
    box-shadow: var(--amp-shadow-md);
}

.amp-auth-form-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--amp-text);
}

.amp-auth-form-sub {
    font-size: 13px;
    color: var(--amp-text-muted);
    margin: 0 0 1.25rem;
}

.amp-auth-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 14px;
}

.amp-auth-links a {
    color: var(--amp-primary);
    text-decoration: none;
    font-weight: 600;
}

.amp-auth-links a:hover {
    text-decoration: underline;
}

.amp-auth-links .sep {
    color: var(--amp-text-tertiary);
    margin: 0 8px;
}

/* Mensajes */
.amp-alert {
    padding: 12px 14px;
    border-radius: var(--amp-radius-sm);
    font-size: 14px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.amp-alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.amp-alert-success {
    background: var(--amp-success-light);
    color: var(--amp-success);
}

.amp-alert-info {
    background: var(--amp-accent-light);
    color: var(--amp-accent-dark);
}

.amp-alert-warning {
    background: var(--amp-warning-light);
    color: var(--amp-warning);
}

.amp-alert-danger {
    background: var(--amp-danger-light);
    color: var(--amp-danger);
}

/* Asistencia: cards de tipo de evento */
.amp-asist-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.amp-asist-card {
    background: var(--amp-card);
    border: 1px solid var(--amp-border);
    border-radius: var(--amp-radius-md);
    padding: 1rem;
}

.amp-asist-card.urgente {
    border: 2px solid var(--amp-danger);
    background: var(--amp-danger-light);
}

.amp-asist-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.amp-asist-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.amp-asist-card-icon.cristal {
    background: var(--amp-accent-light);
    color: var(--amp-accent);
}
.amp-asist-card-icon.granizo {
    background: var(--amp-primary-light);
    color: var(--amp-primary);
}
.amp-asist-card-icon.remolque {
    background: var(--amp-danger);
    color: white;
}

.amp-asist-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--amp-text);
}

.amp-asist-card-sub {
    font-size: 13px;
    color: var(--amp-text-muted);
    margin-top: 2px;
}

.amp-asist-card-body {
    font-size: 13px;
    color: var(--amp-text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.amp-badge-urgente {
    display: inline-block;
    background: var(--amp-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Pantalla de "Listo" */
.amp-listo {
    text-align: center;
    padding: 2rem 1rem;
}

.amp-listo-icon {
    width: 80px;
    height: 80px;
    background: var(--amp-success-light);
    color: var(--amp-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin: 0 auto 1rem;
}

.amp-listo-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--amp-text);
    margin: 0 0 0.5rem;
}

.amp-listo-text {
    font-size: 15px;
    color: var(--amp-text-muted);
    max-width: 320px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

/* Listas (cuotas, datos) */
.amp-list {
    background: var(--amp-card);
    border: 1px solid var(--amp-border);
    border-radius: var(--amp-radius-md);
    overflow: hidden;
}

.amp-list-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--amp-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.amp-list-item:last-child { border-bottom: 0; }

.amp-list-icon {
    color: var(--amp-text-muted);
    font-size: 20px;
    flex-shrink: 0;
}

.amp-list-content { flex: 1; min-width: 0; }
.amp-list-label {
    font-size: 11px;
    color: var(--amp-text-tertiary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.amp-list-value {
    font-size: 15px;
    color: var(--amp-text);
    font-weight: 500;
}

.amp-list-action {
    flex-shrink: 0;
}

/* Cuota item */
.amp-cuota-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--amp-border);
}

.amp-cuota-item:last-child { border-bottom: 0; }

.amp-cuota-number {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--amp-primary-light);
    color: var(--amp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.amp-cuota-info { flex: 1; min-width: 0; }
.amp-cuota-fecha {
    font-size: 13px;
    font-weight: 600;
    color: var(--amp-text);
}
.amp-cuota-detalle {
    font-size: 12px;
    color: var(--amp-text-muted);
    margin-top: 2px;
}

.amp-cuota-importe {
    font-size: 14px;
    font-weight: 700;
    color: var(--amp-text);
    margin-right: 8px;
}

.amp-cuota-estado {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 999px;
}

.amp-cuota-estado.pagada {
    background: var(--amp-success-light);
    color: var(--amp-success);
}

.amp-cuota-estado.pendiente {
    background: var(--amp-warning-light);
    color: var(--amp-warning);
}

.amp-cuota-estado.vencida {
    background: var(--amp-danger-light);
    color: var(--amp-danger);
}

/* Volver atras */
.amp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--amp-text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    padding: 4px 0;
}

.amp-back:hover {
    color: var(--amp-primary);
    text-decoration: none;
}

/* Pagina full screen */
.amp-page {
    padding: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

.amp-page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--amp-text);
    margin: 0 0 0.25rem;
}

.amp-page-sub {
    font-size: 14px;
    color: var(--amp-text-muted);
    margin: 0 0 1.5rem;
}

/* Responsive desktop */
@media (min-width: 768px) {
    .portal-services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
