/* ==========================================================================
   REGISTRATION PAGE — Two-Column Split Layout
   Mirrors login.css: dark brand panel left | light form panel right
   ========================================================================== */

/* Page container — identical to login */
.registration-container {
    background: linear-gradient(135deg,
        #0a2540 0%,
        #0f3d5c 25%,
        #1a5a8e 50%,
        #2d7aaf 75%,
        #408fc4 100%);
    padding: 2rem 0;
    min-height: calc(100vh - 66px);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.registration-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(45,122,175,0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(64,143,196,0.08) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.registration-container::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 500px; height: 500px;
    background: radial-gradient(circle,
        rgba(45,122,175,0.15) 0%,
        rgba(87,169,216,0.08) 30%,
        transparent 70%);
    pointer-events: none;
    opacity: 0.7;
    z-index: 0;
    animation: pulse-glow 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-15px); }
}

@keyframes pulse-glow {
    0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.7; }
    50%       { transform: translate(-50%, -50%) scale(1.08); opacity: 0.5; }
}

/* ── CARD — two columns, same shell as login ── */
.registration-card {
    background: transparent;
    backdrop-filter: none;
    border-radius: 20px;
    box-shadow:
        0 24px 64px rgba(0,0,0,0.55),
        0 0 80px rgba(45,122,175,0.25),
        inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
    max-width: 960px;   /* slightly wider than login to hold more fields comfortably */
    margin: 0 auto;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.12);
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 580px;
}

/* Top accent line */
.registration-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(26,90,142,0) 0%,
        rgba(45,122,175,0.9) 50%,
        rgba(87,169,216,0) 100%);
    box-shadow: 0 0 24px rgba(45,122,175,0.7);
    z-index: 10;
}

/* ════════════════════════════════════════════
   LEFT PANEL — identical to login
   ════════════════════════════════════════════ */
.reg-panel-left {
    flex: 0 0 38%;
    background: linear-gradient(160deg,
        #071828 0%,
        #0a2540 35%,
        #0f3d5c 65%,
        #1a5a8e 100%);
    padding: 3rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.reg-panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(45,122,175,0.18) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(87,169,216,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.reg-panel-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255,255,255,0.012) 3px,
        rgba(255,255,255,0.012) 4px
    );
    pointer-events: none;
    opacity: 0.6;
}

.reg-brand {
    position: relative;
    z-index: 1;
}

.reg-brand .logo {
    width: 62px;
    height: auto;
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 0 12px rgba(87,169,216,0.4));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.reg-brand .logo:hover {
    filter: drop-shadow(0 0 18px rgba(87,169,216,0.7));
    transform: scale(1.04);
}

.reg-brand-name {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #a8d4ed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.2rem 0;
    line-height: 1;
}

.reg-brand-tagline {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(87,169,216,0.8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 1.5rem 0;
}

.reg-brand-description {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.65;
    margin: 0 0 2rem 0;
    max-width: 240px;
}

/* Benefits list in left panel */
.reg-benefits {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 2rem;
}

.reg-benefit-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
}

.reg-benefit-item i {
    width: 26px;
    height: 26px;
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #10b981;
    flex-shrink: 0;
}

/* Trust badges at the bottom */
.reg-trust-badges {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.reg-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
}

.reg-trust-badge i {
    width: 28px;
    height: 28px;
    background: rgba(45,122,175,0.2);
    border: 1px solid rgba(45,122,175,0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: rgba(87,169,216,0.85);
    flex-shrink: 0;
}

/* ════════════════════════════════════════════
   RIGHT PANEL — light form, matching login
   ════════════════════════════════════════════ */
.reg-panel-right {
    flex: 1;
    background: #f8fafc;
    padding: 2.5rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    overflow-y: auto;
}

/* Subtle divider between panels */
.reg-panel-right::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(45,122,175,0.4) 0%,
        rgba(45,122,175,0.1) 50%,
        transparent 100%);
}

/* ── FORM HEADER ── */
.reg-form-header {
    margin-bottom: 1.5rem;
}

.reg-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0a1929;
    margin: 0 0 0.3rem 0;
    letter-spacing: -0.01em;
}

.reg-form-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
}

/* ── MAGI FIELDS — light theme (same as login) ── */
.reg-magi-field {
    position: relative;
    margin-bottom: 1.1rem;
}

.reg-magi-field > .reg-magi-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 16px 3rem 5px 2.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.25;
    color: #111827;
    background: #fff;
    background-image: none;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

/* Kill autofill background */
.reg-magi-field > .reg-magi-input:-webkit-autofill,
.reg-magi-field > .reg-magi-input:-webkit-autofill:hover,
.reg-magi-field > .reg-magi-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 1px 2px rgba(0,0,0,0.04);
    -webkit-text-fill-color: #111827;
    transition: background-color 99999s ease 0s;
}

.reg-magi-field > .reg-magi-input:hover {
    border-color: #9ca3af;
}

.reg-magi-field > .reg-magi-input:focus {
    border-color: #1a5a8e;
    box-shadow: 0 0 0 3px rgba(26,90,142,0.12), 0 1px 2px rgba(0,0,0,0.04);
}

/* Text centered when label is floated and field has value */
.reg-magi-field > .reg-magi-input:not(:placeholder-shown) {
    padding-top: 0;
    padding-bottom: 0;
    line-height: 52px;
}

/* Keep offset only while focused AND empty */
.reg-magi-field > .reg-magi-input:focus:placeholder-shown {
    padding-top: 18px;
    padding-bottom: 6px;
    line-height: 1.25;
}

/* ── LABEL ── */
.reg-magi-field > .reg-magi-label {
    position: absolute;
    top: 0; left: 2.5rem; right: 3rem;
    height: 50px;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 400;
    color: #9ca3af;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform-origin: left center;
    transition: transform 0.18s cubic-bezier(0.4,0,0.2,1), color 0.16s ease;
    z-index: 2;
}

.reg-magi-field > .reg-magi-input:focus ~ .reg-magi-label,
.reg-magi-field > .reg-magi-input:not(:placeholder-shown) ~ .reg-magi-label {
    transform: scale(0.8) translateY(-1.9rem);
    color: #1a5a8e;
    font-weight: 600;
    right: auto;
    width: max-content;
    max-width: calc(100% - 2.5rem);
    padding: 0 0.35rem;
}

/* Chip behind floated label */
.reg-magi-field > .reg-magi-label::after {
    content: '';
    position: absolute;
    top: 30%; bottom: 30%;
    left: 0; right: 0;
    z-index: -1;
    background: #f8fafc;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.reg-magi-field > .reg-magi-input:focus ~ .reg-magi-label::after,
.reg-magi-field > .reg-magi-input:not(:placeholder-shown) ~ .reg-magi-label::after {
    opacity: 1;
}

/* ── LEFT ICON ── */
.reg-magi-icon {
    position: absolute;
    top: 25px; left: 0.875rem;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #9ca3af;
    pointer-events: none;
    z-index: 3;
    transition: color 0.18s ease;
}

.reg-magi-field:focus-within > .reg-magi-icon {
    color: #1a5a8e;
}

/* ── PASSWORD TOGGLE ── */
.reg-password-toggle {
    position: absolute;
    top: 25px; right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s ease;
}

.reg-password-toggle:hover { color: #1a5a8e; }

/* ── VALIDATION STATES ── */
.reg-magi-field > .reg-magi-input.is-valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}
.reg-magi-field > .reg-magi-input.is-valid ~ .reg-magi-label { color: #16a34a; }

.reg-magi-field > .reg-magi-input.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.reg-magi-field > .reg-magi-input.is-invalid ~ .reg-magi-label { color: #dc2626; }

/* ── FEEDBACK ── */
.reg-magi-feedback {
    display: none;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
    padding: 0.35rem 0.55rem;
    border-radius: 5px;
    line-height: 1.4;
}

.reg-magi-feedback.show { display: flex; }

.reg-magi-feedback.error {
    color: #dc2626;
    background: #fff;
    border: 1px solid #fecaca;
    border-left: 3px solid #dc2626;
}

.reg-magi-feedback.error::before {
    content: '\f057';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.68rem;
    flex-shrink: 0;
    margin-top: 0.08rem;
}

.reg-magi-feedback.success {
    color: #16a34a;
    background: #fff;
    border: 1px solid #bbf7d0;
    border-left: 3px solid #16a34a;
}

/* ── PASSWORD STRENGTH ── */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.4s ease;
    width: 0%;
    border-radius: 2px;
}

.strength-weak   { background: #ef4444; width: 33%; }
.strength-medium { background: #f59e0b; width: 66%; }
.strength-strong { background: #16a34a; width: 100%; }

#strengthText {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
}

#strengthText.weak   { color: #dc2626; }
#strengthText.medium { color: #d97706; }
#strengthText.strong { color: #16a34a; }

/* ── CHECKBOX FIELDS ── */
.reg-check-group {
    margin-bottom: 1rem;
}

.reg-check-group .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0;
}

.reg-check-group .form-check-input {
    background-color: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    accent-color: #1a5a8e;
    flex-shrink: 0;
}

.reg-check-group .form-check-input:checked {
    background-color: #1a5a8e;
    border-color: #1a5a8e;
}

.reg-check-group .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(26,90,142,0.12);
    outline: none;
}

.reg-check-group .form-check-label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
}

.reg-check-group .form-check-label a {
    color: #1a5a8e;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.reg-check-group .form-check-label a:hover {
    color: #0f3d5c;
    text-decoration: underline;
}

.invalid-feedback {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.2rem;
}

/* ── SUBMIT BUTTON ── */
.reg-panel-right .btn-primary {
    background: linear-gradient(135deg, #1a5a8e 0%, #2d7aaf 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 4px 14px rgba(26,90,142,0.3);
    cursor: pointer;
    margin-bottom: 0;
}

.reg-panel-right .btn-primary:hover {
    background: linear-gradient(135deg, #0f3d5c 0%, #1a5a8e 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,90,142,0.4);
}

.reg-panel-right .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26,90,142,0.3);
}

.reg-panel-right .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── ALREADY HAVE ACCOUNT ── */
.reg-signin-link {
    text-align: center;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid #e5e7eb;
}

.reg-signin-link p { color: #6b7280; font-size: 0.875rem; margin: 0; }
.reg-signin-link a { color: #1a5a8e; text-decoration: none; font-weight: 600; }
.reg-signin-link a:hover { color: #0f3d5c; text-decoration: underline; }

/* ── BACK LINK ── */
.reg-panel-right .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    transition: color 0.15s ease;
    font-weight: 500;
}

.reg-panel-right .back-link:hover { color: #1a5a8e; }

/* ── ALERTS ── */
.reg-panel-right .alert {
    border-radius: 8px;
    border: 1px solid;
    padding: 0.7rem 0.875rem;
    margin-bottom: 1.1rem;
    border-left-width: 3px;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.reg-panel-right .alert-danger {
    background: #fff;
    border-color: #fecaca;
    border-left-color: #dc2626;
    color: #dc2626;
}

.reg-panel-right .alert-success {
    background: #fff;
    border-color: #bbf7d0;
    border-left-color: #16a34a;
    color: #16a34a;
}

.reg-panel-right .alert-info {
    background: #fff;
    border-color: #bfdbfe;
    border-left-color: #1a5a8e;
    color: #1a5a8e;
}

/* ── LOADING OVERLAY ── */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(248,250,252,0.95);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 10;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #1a5a8e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 16px rgba(26,90,142,0.2);
}

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

/* ════════════════════════════════════════════
   RESPONSIVE — stack on mobile
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
    .registration-container { padding: 1rem 0; padding-right: 1rem; }

    .registration-card {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
        border-radius: 16px;
        margin: 0.75rem;
    }

    .reg-panel-left {
        flex: none;
        padding: 2rem 1.75rem 1.5rem;
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
        min-height: auto;
    }

    .reg-trust-badges,
    .reg-benefits,
    .reg-brand-description { display: none; }

    /* CSS grid: [40px logo] | [Magi name]        */
    /*                        [SAF-T Solutions]     */
    .reg-brand {
        display: grid;
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto;
        column-gap: 0.875rem;
        align-items: center;
    }

    .reg-brand .logo {
        grid-column: 1;
        grid-row: 1 / 3;   /* spans both text rows */
        width: 40px;
        margin-bottom: 0;
        align-self: center;
    }

    .reg-brand-name {
        grid-column: 2;
        grid-row: 1;
        font-size: 1.35rem;
        margin: 0;
        line-height: 1.2;
        align-self: end;
    }

    .reg-brand-tagline {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        align-self: start;
    }

    .reg-panel-right {
        padding: 1.75rem 1.5rem 2rem;
    }

    .step-label { display: none; }
}

/* ── Extra-small phones (< 480px) ── */
@media (max-width: 480px) {
    .registration-card {
        margin: 0.5rem;
        border-radius: 12px;
    }

    .reg-panel-left {
        padding: 1.5rem 1.125rem;
    }

    .reg-panel-right {
        padding: 1.5rem 1.125rem 1.75rem;
    }
}