/* Login Credentials Page Styles */

.totp-credentials-page {
    max-width: 900px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 20px;
}

.cred-header {
    text-align: center;
    background: #fe6401;
    color: white;
    padding: 30px;
    border-radius: 15px 15px 0 0;
    margin-bottom: 20px;
}

.cred-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
}

.cred-header p {
    margin: 0;
    opacity: 0.9;
}

.cred-login {
    max-width: 400px;
    margin: 40px auto;
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.cred-login h3 {
    margin-bottom: 20px;
    color: #333;
}

.cred-login input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.cred-login input:focus {
    outline: none;
    border-color: white;
}

.cred-message {
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

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

.cred-info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196F3;
}

.cred-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.cred-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.cred-messages {
    padding: 0 20px;
}

.btn-subscribe-link {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: #fe6401;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-subscribe-link:hover {
    background: #e55a00;
    text-decoration: none;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #fe6401;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin: 20px 0 10px 0;
    color: #333;
}

.empty-state p {
    color: #666;
    margin: 10px 0;
}

.empty-state a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.empty-state a:hover {
    text-decoration: underline;
}

.credentials-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cred-welcome {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.cred-welcome h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.cred-welcome p {
    margin: 0;
    color: #666;
}

.credential-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s;
}

.credential-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: white;
}

.cred-card-header {
    background: #fe6401;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cred-card-header h4 {
    margin: 0;
    font-size: 20px;
}

.expiry-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.cred-card-body {
    padding: 20px;
}

.cred-field {
    margin-bottom: 20px;
}

.cred-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.cred-value {
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.cred-text {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    color: #1f2937;
    word-break: break-all;
}

.copy-btn, .show-password-btn {
    padding: 6px 12px;
    background: #fe6401;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-btn:hover, .show-password-btn:hover {
    background: #fe6401;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.show-password-btn {
    background: #6b7280;
}

.show-password-btn:hover {
    background: #4b5563;
}

.cred-instructions {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 12px;
    border-radius: 6px;
    color: #92400e;
    line-height: 1.6;
}

.cred-expiry-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.cred-expiry-info small {
    color: #6b7280;
}

.cred-footer {
    margin-top: 30px;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
    text-align: center;
}

.cred-footer p {
    margin: 8px 0;
    color: #4b5563;
}

.cred-footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.cred-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .totp-credentials-page {
        padding: 10px;
    }
    
    .cred-header {
        padding: 20px;
    }
    
    .cred-header h2 {
        font-size: 24px;
    }
    
    .cred-value {
        flex-direction: column;
        gap: 8px;
    }
    
    .cred-text {
        width: 100%;
    }
    
    .copy-btn, .show-password-btn {
        width: 100%;
    }
    
    .cred-card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Dashboard Link */
.cred-dashboard-link {
    padding: 15px 20px;
    background: #a55014;
    border-bottom: 1px solid #8a4210;
    text-align: center;
}

.cred-dashboard-link .dashboard-btn {
    display: inline-block;
    padding: 12px 28px;
    background: transparent;
    border: 2px solid #ffffff;
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
}

.cred-dashboard-link .dashboard-btn:hover {
    background: #ffffff;
    text-decoration: none;
    color: #a55014 !important;
}

/* Section titles */
.section-title {
    margin: 30px 0 15px 0;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 18px;
}

.section-title.active-section {
    background: #d1fae5;
    color: #047857;
}

.section-title.expired-section {
    background: #fef2f2;
    color: #dc2626;
}

/* Expired credential card */
.credential-card.expired-card {
    border: 2px solid #fca5a5;
    background: #fef2f2;
    position: relative;
}

.credential-card.expired-card .cred-card-header {
    background: #dc2626;
}

.credential-card.expired-card .cred-card-body {
    position: relative;
}

.expired-overlay {
    background: rgba(255, 255, 255, 0.95);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 0 0 10px 10px;
}

.expired-message {
    text-align: center;
    padding: 20px;
}

.expired-message p {
    margin: 8px 0;
    color: #991b1b;
}

.expired-message .renew-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #dc2626;
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s;
}

.expired-message .renew-btn:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

.cred-field.blurred {
    filter: blur(3px);
    opacity: 0.5;
    pointer-events: none;
}

.btn-expired-action {
    padding: 6px 12px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-expired-action:hover {
    background: #b91c1c;
}

/* Get OTP Code button styles - REDESIGNED for more visibility */
.cred-otp-button-container {
    margin: 20px 0 15px 0;
    padding: 0;
}

.btn-get-otp-prominent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, #040a30 0%, #0a1a4a 50%, #1a237e 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(4, 10, 48, 0.4), 0 0 0 3px rgba(165, 80, 20, 0.3);
    border: 2px solid #a55014;
    position: relative;
    overflow: hidden;
}

.btn-get-otp-prominent::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.btn-get-otp-prominent:hover::before {
    left: 100%;
}

.btn-get-otp-prominent:hover {
    background: linear-gradient(135deg, #0a1a4a 0%, #1a237e 50%, #283593 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(4, 10, 48, 0.5), 0 0 0 3px rgba(165, 80, 20, 0.5);
    color: #ffffff !important;
    text-decoration: none;
}

.otp-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #a55014;
    border-radius: 10px;
    flex-shrink: 0;
}

.otp-btn-icon svg {
    stroke: #ffffff;
    width: 24px;
    height: 24px;
}

.otp-btn-text {
    flex: 1;
    text-align: left;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.otp-btn-text strong {
    font-size: 18px;
    color: #fe6401;
    display: block;
}

.otp-btn-text small {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.otp-btn-arrow {
    font-size: 24px;
    color: #fe6401;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.btn-get-otp-prominent:hover .otp-btn-arrow {
    transform: translateX(5px);
}

/* Mobile responsive for OTP button */
@media (max-width: 480px) {
    .btn-get-otp-prominent {
        padding: 15px;
    }
    
    .otp-btn-icon {
        width: 40px;
        height: 40px;
    }
    
    .otp-btn-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .otp-btn-text strong {
        font-size: 16px;
    }
    
    .otp-btn-text small {
        font-size: 12px;
    }
}

/* Old styles kept for backwards compatibility */
.cred-action-buttons {
    margin-top: 20px;
    margin-bottom: 15px;
    text-align: center;
}

.btn-get-otp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #040a30 0%, #1a237e 100%);
    color: #fe6401 !important;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(4, 10, 48, 0.4);
}

.btn-get-otp:hover {
    background: linear-gradient(135deg, #0a1245 0%, #283593 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(4, 10, 48, 0.5);
    color: #ff7c1a !important;
    text-decoration: none;
}

.btn-get-otp svg {
    stroke: #fe6401;
    width: 20px;
    height: 20px;
}

.btn-get-otp:hover svg {
    stroke: #ff7c1a;
}

/* View Login Details button styles (for OTP page) */
.btn-view-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-view-login:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    transform: translateY(-2px);
    color: white !important;
    text-decoration: none;
}

/* v12.0.5 — Credentials page mobile fixes */
@media (max-width: 600px) {
    .totp-credentials-page {
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }
    .cred-header {
        padding: 14px 16px !important;
        border-radius: 0 !important;
    }
    .credential-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 14px !important;
        box-sizing: border-box !important;
    }
    .credential-value {
        font-size: 14px !important;
        word-break: break-all !important;
    }
}

/* ── v12.9.0: brand logo in the orange credentials header ─────────────────── */
.totp-credentials-page .cred-header-logo {
    text-align: center !important;
    line-height: 0 !important;
    margin: 0 0 14px !important;
}
.totp-credentials-page .cred-header-logo img.ms-brand-logo {
    height: 46px !important;
    width: auto !important;
    max-width: 220px !important;
    display: inline-block !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}
@media (max-width: 600px) {
    .totp-credentials-page .cred-header-logo img.ms-brand-logo {
        height: 38px !important;
    }
    .totp-credentials-page .cred-header-logo { margin-bottom: 10px !important; }
}

/* ============================================================
   v13.2.0 — Passwordless slots (e.g. ChatGPT)
   Accounts with no password: signing in mails a one-time code,
   so we show instructions and a fetch button instead of a
   password field and an OTP link.
   ============================================================ */

.cred-passwordless-notice {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe) !important;
    border: 1px solid #ddd6fe !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    margin: 10px 0 !important;
}

.cred-passwordless-notice .cred-pl-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #5b21b6 !important;
    margin-bottom: 6px !important;
}

.cred-passwordless-notice .cred-pl-body {
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #4c1d95 !important;
}

/* Fetch button — mirrors .btn-get-otp-prominent so the card stays consistent */
.btn-get-login-code {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    background: linear-gradient(135deg, #7c5cfc, #6d28d9) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    cursor: pointer !important;
    text-align: left !important;
    font-family: inherit !important;
    min-height: 44px !important;
    touch-action: manipulation !important;
    transition: transform .15s ease, box-shadow .15s ease !important;
}

.btn-get-login-code:hover:not(.is-disabled) {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(124, 92, 252, .32) !important;
}

.btn-get-login-code.is-disabled,
.btn-get-login-code:disabled {
    background: #9ca3af !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: .8 !important;
}

.btn-get-login-code .otp-btn-icon { display: flex !important; align-items: center !important; }
.btn-get-login-code .otp-btn-text { flex: 1 !important; display: block !important; }
.btn-get-login-code .otp-btn-text strong { display: block !important; font-size: 15px !important; font-weight: 700 !important; color: #fff !important; }
.btn-get-login-code .otp-btn-text small  { display: block !important; font-size: 12px !important; opacity: .9 !important; color: #fff !important; margin-top: 2px !important; }
.btn-get-login-code .otp-btn-arrow { font-size: 18px !important; color: #fff !important; }

/* Result panel */
.login-code-result { margin-top: 10px !important; }

.login-code-result .lc-ok {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    text-align: center !important;
}

.login-code-result .lc-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: #059669 !important;
    margin-bottom: 6px !important;
}

.login-code-result .lc-code {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    letter-spacing: 5px !important;
    color: #065f46 !important;
    margin-bottom: 10px !important;
    word-break: break-all !important;
}

.login-code-result .lc-copy {
    background: #059669 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 9px 22px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    min-height: 44px !important;
    touch-action: manipulation !important;
}

.login-code-result .lc-meta {
    margin-top: 9px !important;
    font-size: 12px !important;
    color: #047857 !important;
}

.login-code-result .lc-err {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 10px !important;
    padding: 12px 15px !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: #991b1b !important;
}

@media (prefers-reduced-motion: reduce) {
    .btn-get-login-code { transition: none !important; }
    .btn-get-login-code:hover:not(.is-disabled) { transform: none !important; }
}

/* ==========================================================================
   SIGN-IN LINK BUTTON (v14.4.1)
   Services that email a one-click link instead of a numeric code. Styled from
   the same shell as .btn-get-login-code so the card stays coherent, in the
   brand purple so members can tell the two flows apart.
   ========================================================================== */

.btn-get-login-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: linear-gradient(135deg, #7c5cfc 0%, #5b3fd6 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s ease;
}

.btn-get-login-link:hover:not(.is-disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 92, 252, 0.4);
}

.btn-get-login-link.is-disabled,
.btn-get-login-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-get-login-link .otp-btn-icon { display: flex; align-items: center; }
.btn-get-login-link .otp-btn-text { flex: 1; min-width: 0; }
.btn-get-login-link .otp-btn-text strong { display: block; font-size: 15px; font-weight: 700; }
.btn-get-login-link .otp-btn-text small { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.btn-get-login-link .otp-btn-arrow { opacity: 0.8; }

.cred-ml-start { margin: 10px 0 8px; }

.cred-ml-start-link {
    display: block;
    padding: 11px 14px;
    border: 1px dashed rgba(124, 92, 252, 0.55);
    border-radius: 10px;
    color: #5b3fd6;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: rgba(124, 92, 252, 0.06);
}

.cred-ml-start-link:hover { background: rgba(124, 92, 252, 0.12); }

.lc-link-btn {
    display: inline-block;
    background: linear-gradient(135deg, #22c58b 0%, #12a06c 100%);
    color: #fff !important;
    text-decoration: none;
    padding: 12px 26px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 15px;
    margin: 8px 0;
}

.lc-link-btn:hover { box-shadow: 0 6px 18px rgba(34, 197, 139, 0.4); }

.lc-copy-link { display: block; margin: 6px auto 0; }

.lc-err {
    background: rgba(255, 176, 32, 0.14);
    border: 1px solid rgba(255, 176, 32, 0.45);
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 13px;
    color: #92400e;
}

@media (max-width: 600px) {
    .lc-link-btn { display: block; text-align: center; }
}

/* v14.4.2: single line of copy above the Sign In button */
.cred-ml-desc {
    color: #475569;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0 8px 0;
}

/* v14.5.1: the Sign In button once it holds the live link */
a.btn-get-login-link.is-ready {
    text-decoration: none;
    background: linear-gradient(135deg, #22c58b 0%, #12a06c 100%);
    color: #fff !important;
    justify-content: space-between;
}

a.btn-get-login-link.is-ready .otp-btn-arrow { font-size: 18px; }
