/* =============================================
   DeltaX Identity Provider – Auth Styles
   Clean light theme, fully responsive
   ============================================= */

:root {
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
    --primary-glow: rgba(34, 197, 94, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --input-bg: #f8fafc;
    --input-border: #cbd5e1;
    --input-focus-border: #22c55e;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --blob-primary-color: #dcfce7;
    --blob-secondary-color: #e0f2fe;
    --overlay-color: rgba(248, 250, 252, 0.4);
}

/* ---- Base Layout ---- */

body.auth-body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Animated background blobs */
body.auth-body::before,
body.auth-body::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

body.auth-body::before {
    background: radial-gradient(circle, var(--blob-primary-color) 0%, transparent 70%);
    top: 10%;
    left: 15%;
    animation: floatBlob1 25s infinite alternate ease-in-out;
}

body.auth-body::after {
    background: radial-gradient(circle, var(--blob-secondary-color) 0%, transparent 70%);
    bottom: 10%;
    right: 15%;
    animation: floatBlob2 25s infinite alternate ease-in-out;
}

@keyframes floatBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

@keyframes floatBlob2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, -30px) scale(1.1); }
}

.auth-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, transparent 40%, var(--overlay-color) 100%);
    z-index: 1;
    pointer-events: none;
}

.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

/* ---- Card ---- */

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.03),
        0 8px 10px -6px rgba(0, 0, 0, 0.03),
        0 0 1px rgba(0, 0, 0, 0.1);
}

/* ---- Logo & Header ---- */

.auth-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    text-align: center;
}

.logo-box {
    width: 48px;
    height: 48px;
    background-color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-box-image {
    width: auto;
    height: auto;
    background: none;
    border: none;
    box-shadow: none;
    margin-bottom: 18px;
}

.logo-box svg {
    width: 26px;
    height: 26px;
    color: white;
}

.brand-logo-image {
    max-width: 140px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.auth-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 0;
    font-weight: 400;
}

/* ---- Form Elements ---- */

.form-group-custom {
    margin-bottom: 20px;
}

.form-label-custom {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.email-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-custom-wrapper {
    position: relative;
    width: 100%;
}

.input-custom {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.input-custom-wrapper .input-custom {
    padding-right: 44px;
}

.input-custom:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: #ffffff;
}

.input-custom[readonly] {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-custom::placeholder {
    color: #94a3b8;
}

/* ---- Email Change Link ---- */

.email-change-link {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s;
}

.email-change-link:hover {
    font-weight: 500;
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ---- Password Toggle ---- */

.toggle-password-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: var(--text-primary);
}

.toggle-password-btn svg {
    width: 20px;
    height: 20px;
}

/* ---- Forgot Password ---- */

.forgot-password-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ---- Buttons ---- */

.btn-primary-custom {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-primary-custom:active {
    transform: translateY(0);
}

.btn-primary-custom:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ---- Provider Divider ---- */

.provider-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 24px 0 16px;
    font-weight: 500;
}

.provider-divider::before,
.provider-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.provider-divider:not(:empty)::before {
    margin-right: .75em;
}

.provider-divider:not(:empty)::after {
    margin-left: .75em;
}

/* ---- Social Provider Buttons ---- */

.providers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #334155;
}

.btn-provider:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-provider:active {
    transform: translateY(0);
}

.btn-provider img,
.btn-provider svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- Back to Login ---- */

.back-to-login {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 20px;
    font-weight: 500;
    transition: color 0.2s;
}

.back-to-login:hover {
    color: var(--primary-color);
}

/* ---- Spinner ---- */

.spinner-custom {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Alerts ---- */

.alert-custom {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    line-height: 1.5;
}

.alert-custom-danger {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: var(--error-color);
}

.alert-custom-success {
    background-color: #f0fdf4;
    border: 1px solid #dcfce7;
    color: var(--success-color);
}

/* ---- Legal Text ---- */

.auth-legal-text {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 20px;
}


/* =============================================
   Responsive Breakpoints
   ============================================= */

/* Large Desktop (> 1200px) – default styles apply, centered card */

/* Tablet (768px – 1024px) */
@media (max-width: 1024px) {
    .auth-wrapper {
        max-width: 420px;
        padding: 20px;
    }
}

/* Small Tablet / Large Phone (481px – 768px) */
@media (max-width: 768px) {
    .auth-wrapper {
        max-width: 400px;
        padding: 16px;
    }

    .auth-card {
        padding: 32px 28px;
    }

    .auth-logo-text {
        font-size: 20px;
    }
}

/* Mobile (≤ 480px) – native full-screen feel */
@media (max-width: 480px) {
    body.auth-body {
        background-color: var(--card-bg);
        align-items: flex-start;
        padding-top: 0;
    }

    /* Remove decorative blobs */
    body.auth-body::before,
    body.auth-body::after,
    .auth-overlay {
        display: none;
    }

    .auth-wrapper {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }

    .auth-card {
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 32px 20px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .auth-logo-container {
        margin-top: 24px;
        margin-bottom: 32px;
    }

    .logo-box {
        width: 44px;
        height: 44px;
    }

    .logo-box-image {
        margin-bottom: 16px;
    }

    .logo-box svg {
        width: 24px;
        height: 24px;
    }

    .brand-logo-image {
        max-width: 120px;
        max-height: 56px;
    }

    .auth-logo-text {
        font-size: 20px;
    }

    .input-custom {
        padding: 14px;
        font-size: 15px;
        border-radius: 12px;
    }

    .input-custom-wrapper .input-custom {
        padding-right: 48px;
    }

    .btn-primary-custom {
        padding: 14px;
        font-size: 16px;
        border-radius: 12px;
    }

    .btn-provider {
        padding: 14px;
        font-size: 15px;
        border-radius: 12px;
    }

    .auth-legal-text {
        display: none;
    }
}
