/* ==========================================================================
   UCE Auth — Login / Register / Password / Verify
   ========================================================================== */

/* Layout ------------------------------------------------------------------- */
.uce-auth-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 80vh;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

.uce-auth-wrap--narrow {
    max-width: 520px;
    align-items: flex-start;
    padding-top: 60px;
}

.uce-auth-wrap--register {
    max-width: 680px;
    align-items: flex-start;
}

/* Card --------------------------------------------------------------------- */
.uce-auth-card {
    flex: 1;
    background: var(--uce-bg-card, #111d2f);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 48px 44px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    max-width: 520px;
}

.uce-auth-card--wide {
    max-width: 100%;
}

.uce-auth-card--centered {
    text-align: center;
}

/* Header ------------------------------------------------------------------- */
.uce-auth-card-header {
    margin-bottom: 36px;
}

.uce-auth-logo {
    margin-bottom: 20px;
}

.uce-auth-logo img {
    max-height: 52px;
    width: auto;
}

.uce-auth-site-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--uce-gold, #c8a042);
    letter-spacing: 0.02em;
}

.uce-auth-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: var(--uce-text-primary, #e2eaf5) !important;
    margin: 0 0 8px !important;
    line-height: 1.2 !important;
}

.uce-auth-subtitle {
    font-size: 15px;
    color: var(--uce-text-muted, #7ba7d4);
    margin: 0;
}

.uce-auth-icon-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(200, 160, 66, 0.12);
    color: var(--uce-gold, #c8a042);
    margin: 0 auto 20px;
}

.uce-auth-icon-header--success {
    background: rgba(25, 135, 84, 0.15);
    color: #2ecc71;
}

.uce-auth-icon-header--error {
    background: rgba(220, 53, 69, 0.15);
    color: #e74c3c;
}

.uce-auth-icon-header--warning {
    background: rgba(255, 193, 7, 0.15);
    color: #f39c12;
}

/* Notices ------------------------------------------------------------------ */
.uce-auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    background: rgba(200, 160, 66, 0.1);
    border: 1px solid rgba(200, 160, 66, 0.25);
    color: #e8c96b;
}

.uce-auth-notice svg { flex-shrink: 0; margin-top: 1px; }

.uce-auth-notice--success {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
    color: #5eee9a;
}

.uce-auth-notice--error {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
    color: #f08080;
}

/* Form --------------------------------------------------------------------- */
.uce-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.uce-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.uce-form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--uce-text-muted, #7ba7d4);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.uce-form-label .required {
    color: #e74c3c;
}

.uce-form-label-link {
    font-weight: 400;
    color: var(--uce-gold, #c8a042);
    text-decoration: none;
    font-size: 12px;
}

.uce-form-label-link:hover { text-decoration: underline; }

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

.uce-input-icon {
    position: absolute;
    left: 14px;
    color: var(--uce-text-dim, #4a6280);
    pointer-events: none;
    flex-shrink: 0;
}

.uce-form-input {
    width: 100%;
    padding: 11px 42px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--uce-text-primary, #e2eaf5);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.uce-form-input::placeholder { color: var(--uce-text-dim, #4a6280); }

.uce-form-input:focus {
    border-color: var(--uce-gold, #c8a042);
    box-shadow: 0 0 0 3px rgba(200, 160, 66, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.uce-form-input.has-error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.uce-password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--uce-text-dim, #4a6280);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.uce-password-toggle:hover { color: var(--uce-text-muted, #7ba7d4); }

/* Password strength -------------------------------------------------------- */
.uce-password-strength {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.06);
    margin-top: 6px;
    overflow: hidden;
    transition: background 0.3s;
}

.uce-password-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.uce-strength-weak   .uce-password-strength-bar { width: 25%; background: #e74c3c; }
.uce-strength-fair   .uce-password-strength-bar { width: 50%; background: #f39c12; }
.uce-strength-good   .uce-password-strength-bar { width: 75%; background: #2ecc71; }
.uce-strength-strong .uce-password-strength-bar { width: 100%; background: #00d4aa; }

/* Checkboxes --------------------------------------------------------------- */
.uce-form-check { margin: -4px 0; }

.uce-form-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uce-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--uce-text-muted, #7ba7d4);
    line-height: 1.5;
}

.uce-check-input { display: none; }

.uce-check-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.uce-check-input:checked + .uce-check-box {
    background: var(--uce-gold, #c8a042);
    border-color: var(--uce-gold, #c8a042);
}

.uce-check-input:checked + .uce-check-box::after {
    content: '';
    display: block;
    width: 10px;
    height: 7px;
    border-left: 2px solid #0d1827;
    border-bottom: 2px solid #0d1827;
    transform: translateY(-1px) rotate(-45deg);
}

/* Account type grid -------------------------------------------------------- */
.uce-account-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.uce-account-type-card {
    cursor: pointer;
    display: block;
}

.uce-account-type-card input[type="radio"] { display: none; }

.uce-type-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--uce-text-muted, #7ba7d4);
    transition: all 0.2s;
    text-align: center;
}

.uce-type-card-inner:hover {
    border-color: rgba(200, 160, 66, 0.3);
    background: rgba(200, 160, 66, 0.05);
    color: var(--uce-text-primary, #e2eaf5);
}

.uce-account-type-card input:checked + .uce-type-card-inner {
    border-color: var(--uce-gold, #c8a042);
    background: rgba(200, 160, 66, 0.08);
    color: var(--uce-gold, #c8a042);
    box-shadow: 0 0 0 3px rgba(200, 160, 66, 0.1);
}

.uce-type-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.uce-type-card-label {
    font-size: 13px;
    font-weight: 600;
}

/* Role-specific fields ----------------------------------------------------- */
.uce-role-fields {
    background: rgba(200, 160, 66, 0.04);
    border: 1px solid rgba(200, 160, 66, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-top: 4px;
    animation: uce-role-in 0.2s ease;
}

@keyframes uce-role-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.uce-role-fields-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #c8a042;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(200, 160, 66, 0.1);
}

/* Buttons ------------------------------------------------------------------ */
.uce-btn-full { width: 100%; justify-content: center; }

.uce-btn-lg {
    padding: 13px 28px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Auth footer / links ------------------------------------------------------ */
.uce-auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--uce-text-dim, #4a6280);
}

.uce-auth-footer p { margin: 0; }

.uce-auth-link {
    color: var(--uce-gold, #c8a042);
    font-weight: 600;
    text-decoration: none;
}

.uce-auth-link:hover { text-decoration: underline; }

.uce-auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--uce-text-muted, #7ba7d4);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.uce-auth-back-link:hover { color: var(--uce-text-primary, #e2eaf5); }

.uce-auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--uce-gold, #c8a042);
    font-weight: 600;
    font-size: inherit;
}

.uce-auth-link-btn:hover { text-decoration: underline; }

.uce-auth-cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

/* Right panel (branding) --------------------------------------------------- */
.uce-auth-bg-panel {
    flex: 0 0 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: linear-gradient(145deg, #0d1827 0%, #1a2f4e 60%, #0d2238 100%);
    border-radius: 0 16px 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: none;
    position: relative;
    overflow: hidden;
}

.uce-auth-bg-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 160, 66, 0.08) 0%, transparent 70%);
}

.uce-auth-bg-content { position: relative; z-index: 1; }

.uce-auth-bg-badge {
    display: inline-flex;
    padding: 4px 14px;
    border-radius: 100px;
    border: 1px solid rgba(200, 160, 66, 0.4);
    color: var(--uce-gold, #c8a042);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.uce-auth-bg-content h2 {
    font-size: 26px;
    font-weight: 700;
    color: #e2eaf5;
    margin: 0 0 14px;
    line-height: 1.3;
}

.uce-auth-bg-content p {
    color: #7ba7d4;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 28px;
}

.uce-auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uce-auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #c8d6e8;
}

.uce-auth-features li svg {
    color: #2ecc71;
    flex-shrink: 0;
}

/* Already logged in notice */
.uce-already-logged-in {
    text-align: center;
    padding: 40px;
    color: var(--uce-text-muted, #7ba7d4);
}

/* Spin animation for loading state */
@keyframes uce-spin {
    to { transform: rotate(360deg); }
}

.uce-spin {
    animation: uce-spin 0.8s linear infinite;
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 880px) {
    .uce-auth-bg-panel { display: none; }
    .uce-auth-card { max-width: 100%; border-radius: 12px; }
    .uce-auth-wrap { min-height: unset; padding: 24px 16px; }
}

@media (max-width: 600px) {
    .uce-auth-card { padding: 32px 24px; }
    .uce-form-row { grid-template-columns: 1fr; }
    .uce-account-type-grid { grid-template-columns: repeat(2, 1fr); }
    .uce-auth-title { font-size: 22px !important; }
}
