/* ============================================
   MAXMAG Auth - Frontend Styles v4
   Desktop: image left (no gaps) | Mobile/Tablet: image hidden
   ============================================ */

/* Reset theme interference */
.maxmag-auth-page,
.maxmag-auth-page * {
    box-sizing: border-box;
}

.maxmag-auth-page {
    margin: 0 !important;
    padding: 0 !important;
    font-family: var(--maxmag-font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: #ffffff;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* ===== DESKTOP LAYOUT (min-width: 1025px) ===== */
.maxmag-auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Left Side - Image, NO gaps, sticks to left edge */
.maxmag-auth-left {
    width: 40%;
    min-height: 130vh;
    height: 130vh;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
}

.maxmag-side-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border: none;
    margin: 0;
    padding: 0;
}

.maxmag-auth-logo {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
}

.maxmag-auth-logo img {
    max-height: 34px;
    width: auto;
    display: block;
}

.maxmag-auth-logo-text {
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.maxmag-auth-logo-text small {
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: #888;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Right Side - Form, takes remaining width */
.maxmag-auth-right {
    width: 60%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 80px;
    position: relative;
    background: #ffffff;
    margin: 0;
}

/* Side on right variant (desktop only) */
.maxmag-auth-wrapper.maxmag-side-right {
    flex-direction: row-reverse;
}

.maxmag-auth-wrapper.maxmag-side-right .maxmag-auth-logo {
    left: auto;
    right: 28px;
}

/* Switch link */
.maxmag-auth-switch {
    position: absolute;
    top: 28px;
    right: 60px;
    font-size: 14px;
    color: #333;
    font-weight: 400;
    z-index: 5;
}

.maxmag-auth-switch a {
    color: var(--maxmag-primary, #ff2d78);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
    margin-left: 4px;
}

.maxmag-auth-switch a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Form Header */
.maxmag-auth-header {
    margin-bottom: 44px;
}

.maxmag-auth-header h1 {
    font-size: 46px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.05;
    letter-spacing: -1.5px;
}

.maxmag-auth-header p {
    font-size: 20px;
    color: #c8c8c8;
    margin: 0;
    font-weight: 400;
}

/* Form */
.maxmag-auth-form {
    max-width: var(--maxmag-form-width, 520px);
    width: 100%;
}

.maxmag-form-field {
    margin-bottom: 26px;
}

.maxmag-form-field label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.maxmag-form-field label .required {
    color: var(--maxmag-primary, #ff2d78);
    margin-left: 3px;
    font-weight: 700;
}

.maxmag-form-field input[type="text"],
.maxmag-form-field input[type="email"],
.maxmag-form-field input[type="password"] {
    width: 100%;
    padding: 16px 26px;
    font-size: 15px;
    border: 1.5px solid #e8e8e8;
    border-radius: var(--maxmag-input-radius, 50px);
    background: #ffffff;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
    height: 54px;
}

.maxmag-form-field input::placeholder {
    color: #d0d0d0;
    font-weight: 400;
    font-size: 15px;
}

.maxmag-form-field input:focus {
    border-color: var(--maxmag-primary, #ff2d78);
    box-shadow: 0 0 0 4px rgba(255, 45, 120, 0.08);
}

.maxmag-form-field input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.08);
}

/* Links */
.maxmag-auth-links {
    margin: 2px 0 32px 0;
}

.maxmag-auth-links a {
    color: var(--maxmag-primary, #ff2d78);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.maxmag-auth-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Remember me */
.maxmag-remember-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -6px 0 24px 0;
    font-size: 14px;
    color: #666;
}

.maxmag-remember-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--maxmag-primary, #ff2d78);
    cursor: pointer;
}

/* Terms checkbox */
.maxmag-terms-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -6px 0 24px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.maxmag-terms-wrap input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--maxmag-primary, #ff2d78);
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.maxmag-terms-wrap a {
    color: var(--maxmag-primary, #ff2d78);
    text-decoration: none;
    font-weight: 500;
}

/* Button */
.maxmag-auth-btn {
    width: 100%;
    padding: 18px 24px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    background: var(--maxmag-primary, #ff2d78);
    border: none;
    border-radius: var(--maxmag-btn-radius, 50px);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    height: 58px;
    margin-top: 6px;
}

.maxmag-auth-btn:hover {
    background: var(--maxmag-primary-hover, #e01a60);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 45, 120, 0.25);
}

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

.maxmag-auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.maxmag-auth-btn .btn-loader {
    display: none;
}

.maxmag-auth-btn.loading .btn-text {
    opacity: 0;
}

.maxmag-auth-btn.loading .btn-loader {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    letter-spacing: 1px;
}

/* Role Selection */
.maxmag-role-section {
    margin: 28px 0;
}

.maxmag-role-section > label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 18px;
}

.maxmag-role-section > label .required {
    color: var(--maxmag-primary, #ff2d78);
    margin-left: 3px;
}

.maxmag-role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.maxmag-role-option {
    position: relative;
    border: 2px solid #e8e8e8;
    border-radius: 16px;
    padding: 26px 14px 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
}

.maxmag-role-option:hover {
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.maxmag-role-option.selected {
    border-color: var(--maxmag-primary, #ff2d78);
    box-shadow: 0 4px 20px rgba(255, 45, 120, 0.12);
}

.maxmag-role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.maxmag-role-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0;
}

.maxmag-role-option.selected .maxmag-role-check {
    border-color: var(--maxmag-primary, #ff2d78);
    background: var(--maxmag-primary, #ff2d78);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.maxmag-role-option.selected .maxmag-role-check::after {
    content: '✓';
}

.maxmag-role-icon-wrap {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maxmag-role-icon-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.maxmag-role-icon-wrap svg {
    width: 40px;
    height: 40px;
    fill: var(--maxmag-primary, #ff2d78);
}

.maxmag-role-option h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.maxmag-role-option p {
    font-size: 12px;
    color: #999;
    margin: 0;
    line-height: 1.4;
    padding: 0 2px;
}

/* Messages */
.maxmag-auth-message {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.maxmag-auth-message.show {
    display: block;
    animation: maxmagSlideDown 0.3s ease;
}

.maxmag-auth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.maxmag-auth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes maxmagSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* reCAPTCHA */
.maxmag-recaptcha-wrap {
    margin: 20px 0;
    display: flex;
    justify-content: flex-start;
}

/* Already logged in notice */
.maxmag-auth-notice {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 16px;
    font-size: 16px;
    color: #333;
}

.maxmag-auth-notice a {
    color: var(--maxmag-primary, #ff2d78);
    font-weight: 600;
}

/* Background Patterns */
.maxmag-pattern-dots {
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 24px 24px;
}

.maxmag-pattern-grid {
    background-image: linear-gradient(#f0f0f0 1px, transparent 1px), linear-gradient(90deg, #f0f0f0 1px, transparent 1px);
    background-size: 40px 40px;
}

.maxmag-pattern-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 50%, #f5f5f5 100%);
}

/* Social Login */
.maxmag-social-login {
    margin: 24px 0;
    text-align: center;
}

.maxmag-social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: #aaa;
    font-size: 13px;
}

.maxmag-social-divider::before,
.maxmag-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

.maxmag-social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.maxmag-social-btn {
    padding: 12px 24px;
    border: 1.5px solid #e8e8e8;
    border-radius: var(--maxmag-btn-radius, 50px);
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.maxmag-social-btn:hover {
    border-color: #ccc;
    background: #f8f8f8;
}

/* Animations */
.maxmag-animate {
    animation: maxmagFadeInUp 0.6s ease forwards;
    opacity: 0;
}

.maxmag-animate-delay-1 { animation-delay: 0.1s; }
.maxmag-animate-delay-2 { animation-delay: 0.2s; }
.maxmag-animate-delay-3 { animation-delay: 0.3s; }

@keyframes maxmagFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   TABLET (max-width: 1024px) - HIDE IMAGE
   ============================================ */
@media (max-width: 1024px) {
    .maxmag-auth-left {
        display: none !important;
    }

    .maxmag-auth-right {
        width: 100% !important;
        min-height: 100vh;
        padding: 40px 60px;
    }

    .maxmag-auth-header h1 {
        font-size: 38px;
    }

    .maxmag-auth-header p {
        font-size: 18px;
    }

    .maxmag-auth-form {
        max-width: 100%;
    }
}

/* ============================================
   MOBILE (max-width: 768px) - HIDE IMAGE
   ============================================ */
@media (max-width: 768px) {
    .maxmag-auth-left {
        display: none !important;
    }

    .maxmag-auth-right {
        width: 100% !important;
        min-height: 100vh;
        padding: 32px 24px 40px;
        height: auto;
    }

    .maxmag-auth-switch {
        position: relative;
        top: auto;
        right: auto;
        text-align: center;
        margin-bottom: 20px;
        font-size: 14px;
    }

    .maxmag-auth-header {
        margin-bottom: 28px;
        text-align: center;
    }

    .maxmag-auth-header h1 {
        font-size: 28px;
        letter-spacing: -0.5px;
    }

    .maxmag-auth-header p {
        font-size: 15px;
    }

    .maxmag-auth-form {
        max-width: 100%;
        margin: 0 auto;
    }

    .maxmag-form-field {
        margin-bottom: 20px;
    }

    .maxmag-form-field label {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .maxmag-form-field input {
        padding: 14px 20px;
        height: 50px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .maxmag-auth-btn {
        height: 52px;
        padding: 16px;
        font-size: 14px;
    }

    .maxmag-role-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .maxmag-role-option {
        padding: 16px;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 14px;
    }

    .maxmag-role-icon-wrap {
        margin: 0;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
    }

    .maxmag-role-icon-wrap svg {
        width: 32px;
        height: 32px;
    }

    .maxmag-role-option h4 {
        margin-bottom: 2px;
        font-size: 14px;
    }

    .maxmag-role-option p {
        font-size: 12px;
    }

    .maxmag-role-check {
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
    }

    .maxmag-auth-links {
        text-align: center;
    }
}

/* ============================================
   MAXMAG Multi-Step Registration Wizard
   ============================================ */
.maxmag-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 8px;
}

.maxmag-step-dot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.maxmag-step-dot.active {
    opacity: 1;
}

.maxmag-step-dot span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.maxmag-step-dot.active span {
    background: var(--maxmag-primary, #ff2d78);
    color: #fff;
}

.maxmag-step-dot small {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.maxmag-step-panel {
    display: none;
}

.maxmag-step-panel.active {
    display: block;
    animation: maxmagFadeIn 0.3s ease;
}

@keyframes maxmagFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.maxmag-step-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
}

.maxmag-step-nav {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.maxmag-step-nav .maxmag-auth-btn {
    flex: 1;
}

.maxmag-btn-secondary {
    background: #f0f0f0 !important;
    color: #333 !important;
}

.maxmag-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.maxmag-plan-card {
    border: 2px solid #eaeaea;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.maxmag-plan-card:hover {
    border-color: var(--maxmag-primary, #ff2d78);
}

.maxmag-plan-card.selected {
    border-color: var(--maxmag-primary, #ff2d78);
    box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.15);
}

.maxmag-plan-card h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.maxmag-plan-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--maxmag-primary, #ff2d78);
    margin-bottom: 12px;
}

.maxmag-plan-price small {
    font-size: 13px;
    font-weight: 500;
    color: #888;
}

.maxmag-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    text-align: left;
    font-size: 13px;
    color: #555;
}

.maxmag-plan-features li {
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}

.maxmag-plan-select-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.maxmag-plan-card.selected .maxmag-plan-select-btn {
    background: var(--maxmag-primary, #ff2d78);
    color: #fff;
}

.maxmag-gateway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.maxmag-gateway-option {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #eaeaea;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.2s;
}

.maxmag-gateway-option:hover {
    border-color: var(--maxmag-primary, #ff2d78);
}

.maxmag-gateway-option.selected {
    border-color: var(--maxmag-primary, #ff2d78);
    background: rgba(255, 45, 120, 0.06);
}

.maxmag-gateway-option input {
    accent-color: var(--maxmag-primary, #ff2d78);
}

/* ===== Full-width (no-sidebar) layout for Step 2 (Model/Influencer) and Step 3 (Membership/Payment) ===== */
.maxmag-auth-page.maxmag-fullwidth-step .maxmag-auth-left {
    display: none;
}

.maxmag-auth-page.maxmag-fullwidth-step .maxmag-auth-right {
    width: 100%;
    padding: 50px 8%;
}

.maxmag-auth-page.maxmag-fullwidth-step .maxmag-auth-form {
    max-width: 900px !important;
    width: 100%;
    margin: 0 auto;
}

.maxmag-auth-page.maxmag-fullwidth-step .maxmag-plans-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
    .maxmag-auth-page.maxmag-fullwidth-step .maxmag-auth-right {
        padding: 40px 24px;
    }

    .maxmag-auth-page.maxmag-fullwidth-step .maxmag-plans-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .maxmag-plans-grid {
        grid-template-columns: 1fr;
    }

    .maxmag-steps-indicator {
        margin-bottom: 24px;
    }

    .maxmag-step-dot small {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .maxmag-auth-right {
        padding: 24px 16px 32px;
    }

    .maxmag-auth-header h1 {
        font-size: 24px;
    }

    .maxmag-auth-header p {
        font-size: 14px;
    }

    .maxmag-auth-btn {
        height: 48px;
        font-size: 13px;
        letter-spacing: 1px;
    }

    .maxmag-form-field input {
        padding: 12px 18px;
        height: 48px;
    }
}
