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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf2 100%);
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    -webkit-font-smoothing: antialiased;
}

.page-wrapper {
    width: 100%;
    max-width: 520px;
    display: flex;
    justify-content: center;
}

/* ---------- CARTE PRINCIPALE ---------- */
.login-card {
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 40px 32px;
    border: 1px solid #eef0f4;
}

/* ---------- EN-TÊTE ---------- */
.login-header {
    margin-bottom: 32px;
    text-align: center;
}

.login-header .logo {
    display: block;
    margin: 0 auto 24px auto;
    max-width: 200px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.login-header .subtitle {
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.5;
}

/* ---------- FORMULAIRE ---------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label,
.card-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    background: #ffffff;
    color: #1a1a1a;
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: #d40000;
    box-shadow: 0 0 0 4px rgba(212, 0, 0, 0.1);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: #f3f4f6;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.clear-btn:hover {
    background: #e5e7eb;
    color: #1a1a1a;
}

/* ---------- SECTION CARTE BANCAIRE ---------- */
.card-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-tabs {
    display: flex;
    gap: 8px;
}

.card-tab {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    background: #2d3b4e;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.card-tab.active {
    background: #2d3b4e;
    color: #ffffff;
}

.card-tab:not(.active) {
    background: #ffffff;
    color: #2d3b4e;
    border: 1.5px solid #2d3b4e;
}

.card-tab:not(.active):hover {
    background: #f0f3f7;
}

/* ---------- CARTE BANCAIRE ---------- */
.credit-card-wrapper {
    display: flex;
    gap: 14px;
    align-items: stretch;
}

.credit-card {
    flex: 1;
    background: #2d3b4e;
    border-radius: 10px;
    padding: 20px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

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

.card-field-label {
    font-size: 12px;
    font-weight: 500;
    color: #cbd5e1;
    letter-spacing: 0.2px;
}

.card-field input {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #1a1a1a;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.card-field input:focus {
    box-shadow: 0 0 0 2px #d40000;
}

.card-field input::placeholder {
    color: #9ca3af;
}

.card-number {
    grid-column: 1 / -1;
}

/* ---------- LOGOS À DROITE ---------- */
.card-logos {
    width: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    flex-shrink: 0;
}

.card-logo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 4px;
    object-fit: contain;
}

.card-logo-secure {
    border: none;
    background: transparent;
    padding: 2px;
}

/* ---------- TOGGLE ---------- */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2196f3;
    color: #ffffff;
    font-size: 11px;
    font-weight: bold;
    font-style: italic;
    cursor: help;
    flex-shrink: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
    background-color: #d40000;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* ---------- BOUTON ---------- */
.submit-btn {
    margin-top: 4px;
    padding: 16px 24px;
    background: #d40000;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    width: 100%;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(212, 0, 0, 0.25);
}

.submit-btn:hover {
    background: #b80000;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(212, 0, 0, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.help-link {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    margin-top: 4px;
    transition: color 0.2s;
}

.help-link:hover {
    color: #d40000;
    text-decoration: underline;
}

/* ---------- CONFIRMATION ---------- */
.confirmation-container {
    text-align: center;
    padding: 50px 32px;
}

.confirmation-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d40000 0%, #b80000 100%);
    color: #ffffff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px auto;
    box-shadow: 0 8px 20px rgba(212, 0, 0, 0.3);
}

.confirmation-container h1 {
    font-size: 20px;
    color: #1a1a1a;
    margin-bottom: 16px;
    font-weight: 700;
}

.confirmation-text {
    font-size: 14.5px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 30px;
}

.back-btn {
    display: inline-block;
    width: auto;
    padding: 14px 32px;
    margin: 0 auto;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 520px) {
    body {
        padding: 12px;
    }
    .login-card {
        padding: 28px 22px;
        border-radius: 14px;
    }
    .login-header h1 {
        font-size: 17px;
    }
    .login-header .subtitle {
        font-size: 13px;
    }
    .credit-card-wrapper {
        flex-direction: column;
    }
    .card-logos {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
    }
    .card-logo {
        width: 50px;
        height: auto;
    }
    .credit-card {
        padding: 18px 16px;
        gap: 12px;
    }
    .card-field input {
        font-size: 14px;
        padding: 11px 12px;
    }
    .form-group input {
        padding: 13px 42px 13px 14px;
        font-size: 14px;
    }
    .submit-btn {
        padding: 15px 20px;
        font-size: 14.5px;
    }
    .confirmation-container {
        padding: 40px 22px;
    }
    .confirmation-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    .confirmation-container h1 {
        font-size: 18px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 24px 18px;
    }
    .credit-card {
        padding: 16px 14px;
    }
    .card-field-label {
        font-size: 11px;
    }
    .card-field input {
        font-size: 13px;
        padding: 10px;
    }
    .card-tab {
        padding: 8px 14px;
        font-size: 12.5px;
    }
}
