/* enrol_redsys — Plugin styles
 *
 * Color palette from CSS custom properties. Override in theme or plugin settings.
 * All colors reference these variables — change here, change everywhere.
 */
:root {
    --redsys-primary: #00796b;
    --redsys-primary-dark: #004d40;
    --redsys-primary-light: #e0f2f1;
    --redsys-text: #263238;
    --redsys-text-muted: #546e7a;
    --redsys-bg: #ffffff;
    --redsys-border: #cfd8dc;
    --redsys-success: #2e7d32;
    --redsys-radius: 12px;
    --redsys-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   Course grid (front page)
   ============================================================ */
.courses-grid-redsys,
.courses-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
    margin: 30px 0 !important;
    padding: 0 15px !important;
}

@media (max-width: 992px) {
    .courses-grid-redsys,
    .courses-list {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .courses-grid-redsys,
    .courses-list {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   Course cards
   ============================================================ */
.course-card {
    background: var(--redsys-bg);
    border-radius: var(--redsys-radius);
    overflow: hidden;
    box-shadow: var(--redsys-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.course-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background-color: #f0f0f0;
    flex-shrink: 0;
}

.course-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover .course-card-image img {
    transform: scale(1.05);
}

.course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.badge-online { background-color: var(--redsys-primary); }
.badge-presencial { background-color: #ff8c00; }
.badge-both { background-color: var(--redsys-text-muted); }
.badge-uned { background-color: #17a2b8; }

.course-card-content {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--redsys-text);
    line-height: 1.3;
}

.course-card-category {
    font-size: 0.7rem;
    color: var(--redsys-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.course-card-tutor {
    font-size: 0.8rem;
    color: var(--redsys-text-muted);
    margin-bottom: 10px;
}

.course-card-description {
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.course-card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--redsys-primary);
    text-align: center;
    margin-bottom: 12px;
}

.course-card-price-free {
    color: var(--redsys-success);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-card-footer {
    margin-top: auto;
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.course-card-footer .btn,
.course-card-footer .redsys-buy-btn {
    background-color: var(--redsys-primary);
    border-color: var(--redsys-primary-dark);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 25px;
    width: 100%;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
}

.course-card-footer .btn:hover,
.course-card-footer .redsys-buy-btn:hover {
    background-color: var(--redsys-primary-dark);
    color: #fff !important;
}

/* ============================================================
   Course detail page — Udemy/Platzi layout
   ============================================================ */

/* Hide Moodle page heading — title is in the card/hero bar */
body.redsys-checkout-page #page-header .page-header-headings,
body.redsys-checkout-page #page-header h1,
body.redsys-checkout-page .page-context-header,
.redsys-auth-wrapper ~ #page-header,
#page-header:has(+ .redsys-auth-wrapper) {
    display: none !important;
}

/* Hide empty heading on buy.php pages */
#page-header .page-header-headings h1:empty,
#page-header .page-header-headings:empty {
    display: none !important;
}

/* Full-width override for Moodle content wrappers */
body.redsys-checkout-page #page-content #region-main-box,
body.redsys-checkout-page #page-content #region-main,
body.redsys-checkout-page #page-content .container-fluid,
body.redsys-checkout-page #region-main .card-body {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Fix sticky sidebar: remove overflow:hidden from ancestor containers.
   Bootstrap .card sets overflow:hidden (for border-radius clipping),
   which breaks position:sticky on any descendant. */
body.redsys-checkout-page #region-main .card,
body.redsys-checkout-page #region-main .card-block,
body.redsys-checkout-page #region-main-box,
body.redsys-checkout-page #region-main,
body.redsys-checkout-page #page-content {
    overflow: visible !important;
}
.enrol-redsys-detail {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Hero bar */
.detail-hero {
    background: var(--redsys-primary-light);
    border-bottom: 3px solid var(--redsys-primary);
    color: var(--redsys-text);
    padding: 32px;
    border-radius: var(--redsys-radius);
    position: relative;
    overflow: hidden;
}

.detail-hero-category {
    display: inline-block;
    color: var(--redsys-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.detail-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
    color: var(--redsys-text);
}

.detail-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--redsys-text-muted);
    margin-top: 6px;
}

.detail-hero-meta .course-badge {
    position: static !important;
    display: inline-block;
}

/* Two-column layout — Platzi-style: left scrolls, right fixed */
.detail-columns {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

.detail-main {
    min-width: 0;
}

/* Left column sections */
.detail-section {
    margin-bottom: 28px;
}

.detail-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--redsys-text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--redsys-primary);
    margin-bottom: 16px;
}

.detail-section-title i {
    color: var(--redsys-primary);
    margin-right: 8px;
}

.detail-description-body {
    color: #444;
    line-height: 1.8;
}

.detail-description-body p {
    margin-bottom: 12px;
}

.detail-description-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Dates */
.detail-date-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-date-label {
    color: var(--redsys-text-muted);
}

/* Pricing table */
.detail-pricing-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-pricing-table thead th {
    background: var(--redsys-primary-light);
    color: var(--redsys-text);
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-pricing-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.detail-price-highlighted {
    background: var(--redsys-primary-light);
}

.detail-price-highlighted td {
    font-weight: 700;
    color: var(--redsys-primary);
}

.detail-price-highlighted i {
    color: var(--redsys-primary);
    margin-left: 6px;
}

.detail-free-badge {
    background: var(--redsys-success);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Right sidebar */
.detail-sidebar {
    align-self: start;
    position: sticky;
    top: 80px;
}

.detail-sidebar-card {
    background: var(--redsys-bg);
    border-radius: var(--redsys-radius);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--redsys-border);
}

.detail-sidebar-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.detail-sidebar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-sidebar-image .course-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Sidebar price */
.detail-sidebar-price {
    padding: 20px 24px 10px;
    text-align: center;
}

.detail-sidebar-amount {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--redsys-text);
    line-height: 1.2;
}

.detail-sidebar-type {
    display: block;
    font-size: 0.8rem;
    color: var(--redsys-text-muted);
    margin-top: 4px;
}

.detail-sidebar-free {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--redsys-success);
}

/* Sidebar form */
.detail-sidebar-form {
    padding: 0 24px 24px;
}

.detail-form-group {
    margin-bottom: 14px;
}

.detail-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--redsys-text);
}

.detail-form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--redsys-text-muted);
    margin-top: 3px;
}

.detail-form-group .form-control {
    border-radius: 8px;
    border: 1px solid var(--redsys-border);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.detail-form-group .form-control:focus {
    border-color: var(--redsys-primary);
    box-shadow: 0 0 0 3px rgba(0, 153, 173, 0.15);
}

.detail-form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.detail-form-check input {
    margin-top: 3px;
    flex-shrink: 0;
}

.detail-cert-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin: 12px 0 16px;
}

.detail-cert-warning i {
    margin-right: 6px;
}

/* Primary button */
.detail-btn-primary {
    display: block;
    width: 100%;
    background: var(--redsys-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.detail-btn-primary:hover {
    background: var(--redsys-primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    text-decoration: none;
}

.detail-btn-enrol {
    margin-top: 8px;
}

/* Secondary button */
.detail-btn-secondary {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--redsys-text-muted);
    border: 1px solid var(--redsys-border);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.85rem;
    text-align: center;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.detail-btn-secondary:hover {
    background: var(--redsys-primary-light);
    color: var(--redsys-primary);
    border-color: var(--redsys-primary);
    text-decoration: none;
}

/* Security badge */
.detail-sidebar-secure {
    text-align: center;
    padding: 14px 24px;
    font-size: 0.78rem;
    color: var(--redsys-text-muted);
    border-top: 1px solid #f0f0f0;
}

.detail-sidebar-secure i {
    color: var(--redsys-success);
    margin-right: 4px;
}

/* UNED block */
.detail-sidebar-uned {
    padding: 24px;
    text-align: center;
}

.detail-sidebar-uned i {
    font-size: 2rem;
    color: var(--redsys-primary);
    margin-bottom: 12px;
}

/* Legal links */
.detail-legal-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 14px 0;
    font-size: 0.75rem;
}

.detail-legal-links a {
    color: var(--redsys-text-muted);
    text-decoration: none;
}

.detail-legal-links a:hover {
    color: var(--redsys-primary);
}

/* Mobile responsive */
@media (max-width: 992px) {
    .detail-columns {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

    .detail-hero-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 576px) {
    .detail-hero {
        padding: 20px;
    }

    .detail-hero-title {
        font-size: 1.2rem;
    }

    .detail-sidebar-card {
        border-radius: 0;
        margin: 0 -15px;
    }
}

/* ============================================================
   Payment form page (buy.php / payment_form_renderer)
   ============================================================ */
.detail-section-header {
    background: var(--redsys-primary-light) !important;
    color: var(--redsys-text) !important;
    border-bottom: 2px solid var(--redsys-primary) !important;
}

.detail-section-header h2,
.detail-section-header h4 {
    color: var(--redsys-text) !important;
}

.detail-price-amount {
    color: var(--redsys-primary);
    font-weight: 700;
}

/* ============================================================
   Enrol page hook button
   ============================================================ */
.enrol_redsys_payment_box {
    text-align: center;
    margin: 15px 0;
}

.enrol_redsys_payment_box .btn,
.enrol_redsys_payment_box .redsys-buy-btn {
    background-color: var(--redsys-primary);
    border-color: var(--redsys-primary-dark);
    color: #fff;
    display: inline-block;
    min-width: 160px;
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.enrol_redsys_payment_box .btn:hover,
.enrol_redsys_payment_box .redsys-buy-btn:hover {
    background-color: var(--redsys-primary-dark);
    color: #fff !important;
}

/* ============================================================
   Instance edit form (admin)
   ============================================================ */
.redsys-prices-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0 20px 0;
}

.redsys-price-card {
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 240px;
    background: var(--redsys-bg);
    border: 2px solid var(--redsys-border);
    border-radius: var(--redsys-radius);
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.redsys-price-card:hover {
    border-color: var(--redsys-primary);
    box-shadow: 0 4px 12px rgba(0, 153, 173, 0.15);
}

.redsys-price-card.is-enabled {
    border-color: var(--redsys-primary);
    background: var(--redsys-primary-light);
}

.redsys-price-card .price-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.redsys-price-card .price-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #343a40;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.redsys-price-card .price-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: var(--redsys-text-muted);
}

.redsys-price-card input[type="number"] {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--redsys-text);
    text-align: center;
    transition: border-color 0.2s ease;
}

.redsys-price-card input[type="number"]:focus {
    border-color: var(--redsys-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 153, 173, 0.15);
}

.redsys-price-card input:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .redsys-prices-row {
        flex-direction: column;
        align-items: center;
    }
    .redsys-price-card {
        max-width: 100%;
        width: 100%;
    }
}

/* ============================================================
   Legal settings page
   ============================================================ */
.redsys-legal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 20px 0;
}

.redsys-legal-card {
    background: var(--redsys-bg);
    border: 1px solid var(--redsys-border);
    border-radius: var(--redsys-radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.redsys-legal-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--redsys-primary);
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

/* ============================================================
   Misc / shared
   ============================================================ */
.redsys-loading {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--redsys-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

a.redsys-buy-btn,
a.redsys-buy-btn:hover,
a.redsys-buy-btn:focus {
    text-decoration: none;
}

/* ============================================================
   Auth page (login / register / forgot password)
   ============================================================ */
.redsys-auth-wrapper {
    display: flex;
    justify-content: center;
    padding: 30px 16px;
    min-height: 60vh;
}

.redsys-auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--redsys-bg);
    border-radius: var(--redsys-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border: 1px solid var(--redsys-border);
}

/* Course summary header */
.redsys-auth-course {
    background: var(--redsys-primary-light);
    border-bottom: 3px solid var(--redsys-primary);
    padding: 24px 28px;
}

.redsys-auth-course-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--redsys-text);
    line-height: 1.3;
}

.redsys-auth-course-desc {
    font-size: 0.82rem;
    color: var(--redsys-text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.redsys-auth-course-price {
    margin-top: 8px;
}

.redsys-auth-price-amount {
    display: inline-block;
    background: var(--redsys-primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
}

.redsys-auth-price-free {
    display: inline-block;
    background: var(--redsys-primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Auth panel (form area) */
.redsys-auth-panel {
    padding: 28px;
}

.redsys-auth-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--redsys-text);
    margin: 0 0 20px 0;
    text-align: center;
}

.redsys-auth-title i {
    color: var(--redsys-primary);
    margin-right: 8px;
}

/* Inline error */
.redsys-auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.redsys-auth-error i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Inline success */
.redsys-auth-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.redsys-auth-success i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* Form fields */
.redsys-auth-field {
    margin-bottom: 16px;
}

.redsys-auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--redsys-text);
    margin-bottom: 6px;
}

.redsys-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid var(--redsys-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.redsys-auth-input-wrap:focus-within {
    border-color: var(--redsys-primary);
    box-shadow: 0 0 0 3px rgba(0, 153, 173, 0.15);
    background: #fff;
}

.redsys-auth-input-wrap > i {
    color: var(--redsys-text-muted);
    font-size: 0.9rem;
    padding-left: 14px;
    flex-shrink: 0;
}

.redsys-auth-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 0.92rem;
    color: var(--redsys-text);
    outline: none;
    min-width: 0;
}

.redsys-auth-input-wrap input::placeholder {
    color: #adb5bd;
}

/* Password toggle button */
.redsys-auth-toggle-pw {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 14px;
    color: var(--redsys-text-muted);
    font-size: 0.95rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.redsys-auth-toggle-pw:hover {
    color: var(--redsys-primary);
}

/* Forgot password link */
.redsys-auth-forgot {
    text-align: right;
    margin-bottom: 16px;
    margin-top: -8px;
}

.redsys-auth-forgot a {
    font-size: 0.8rem;
    color: var(--redsys-primary);
    text-decoration: none;
}

.redsys-auth-forgot a:hover {
    text-decoration: underline;
}

/* Forgot password description */
.redsys-auth-forgot-desc {
    font-size: 0.85rem;
    color: var(--redsys-text-muted);
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

/* Submit button */
.redsys-auth-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: var(--redsys-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-bottom: 16px;
}

.redsys-auth-submit:hover {
    background: var(--redsys-primary-dark);
    transform: translateY(-1px);
}

.redsys-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.redsys-auth-submit-secondary {
    background: transparent;
    color: var(--redsys-primary);
    border: 2px solid var(--redsys-primary);
}

.redsys-auth-submit-secondary:hover {
    background: var(--redsys-primary-light);
    color: var(--redsys-primary-dark);
}

/* Spinner */
.redsys-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

.redsys-auth-submit-secondary .redsys-spinner {
    border-color: rgba(0, 121, 107, 0.3);
    border-top-color: var(--redsys-primary);
}

/* Switch link */
.redsys-auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--redsys-text-muted);
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.redsys-auth-switch a {
    color: var(--redsys-primary);
    font-weight: 600;
    text-decoration: none;
}

.redsys-auth-switch a:hover {
    text-decoration: underline;
}

/* Select inside input wrap */
.redsys-auth-select {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    font-size: 0.92rem;
    color: var(--redsys-text);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* File input */
.redsys-auth-file-input {
    width: 100%;
    border: 1px solid var(--redsys-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    background: #f8f9fa;
    cursor: pointer;
}

.redsys-auth-file-input:focus {
    border-color: var(--redsys-primary);
    box-shadow: 0 0 0 3px rgba(0, 153, 173, 0.15);
}

/* Field help text */
.redsys-auth-field-help {
    display: block;
    font-size: 0.75rem;
    color: var(--redsys-text-muted);
    margin-top: 4px;
    padding-left: 2px;
}

/* Info box */
.redsys-auth-info-box {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.redsys-auth-info-box i {
    margin-right: 6px;
}

/* Checkbox */
.redsys-auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--redsys-text);
}

.redsys-auth-check input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--redsys-primary);
}

/* Disabled input look */
.redsys-auth-input-disabled {
    background: #e9ecef;
    opacity: 0.8;
}

.redsys-auth-input-disabled input {
    cursor: not-allowed;
}

/* ============================================================
   Confirmation page
   ============================================================ */
.redsys-confirm-success {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
}

.redsys-confirm-success i {
    font-size: 1.8rem;
    margin-top: 2px;
}

.redsys-confirm-success strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
}

.redsys-confirm-course {
    font-size: 1.05rem;
    font-weight: 700;
    color: #166534;
    margin: 4px 0 0 0;
}

.redsys-confirm-credentials {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.redsys-confirm-cred-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e40af;
    margin: 0 0 6px 0;
}

.redsys-confirm-cred-title i {
    margin-right: 6px;
}

.redsys-confirm-cred-desc {
    font-size: 0.82rem;
    color: #3b82f6;
    margin: 0 0 12px 0;
}

.redsys-confirm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

.redsys-confirm-table th,
.redsys-confirm-table td {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}

.redsys-confirm-table th {
    width: 30%;
    background: #f8fafc;
    color: var(--redsys-text-muted);
    font-weight: 600;
    text-align: left;
}

.redsys-confirm-email-notice {
    font-size: 0.85rem;
    color: var(--redsys-text-muted);
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.redsys-confirm-email-notice i {
    color: var(--redsys-primary);
    margin-right: 6px;
}

.redsys-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.redsys-confirm-actions .redsys-auth-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    .redsys-auth-wrapper {
        padding: 16px 8px;
    }

    .redsys-auth-card {
        border-radius: 8px;
    }

    .redsys-auth-panel {
        padding: 20px 16px;
    }

    .redsys-auth-course {
        padding: 20px 16px;
    }
}
