/**
 * TrustedLogin styling for GravityOps.
 * Matches GravityKit style with centered card and branding.
 */

#trustedlogin {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* When the header is hidden by AdminShell */
.gops-hide-header {
    margin: -20px -20px 0 -20px !important;
}

.gops-hide-header .gops-content {
    margin: 0;
    background-color: #F6F7FB;
    min-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.gops-tl-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.gops-tl-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.gops-tl-brand {
    font-size: 32px;
    font-weight: 600;
    color: #1d2327;
}

.tl-gravityops_trustedlogin-auth {
    max-width: 600px;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    position: relative;
}

.tl-gravityops_trustedlogin-auth__body {
    background: #F8F5FF;
    border: 1px solid #D8CFF0;
    box-shadow: 0 4px 30px rgba(151, 91, 229, 0.12);
    padding: 40px 60px;
    border-radius: 12px;
}

/* Hide default TL logo header */
.tl-gravityops_trustedlogin-auth__header__top {
    display: none;
}

/* Ensure the auth header with Revoke button is visible and styled */
.tl-gravityops_trustedlogin-auth__header {
    display: block;
    margin-bottom: 20px;
    overflow: hidden;
}

.tl-gravityops_trustedlogin-auth__header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.tl-gravityops_trustedlogin-auth__meta {
    font-size: 13px;
    color: #646970;
}

.tl-client-revoke-button {
    margin-top: 5px;
}

p strong {
    font-size: inherit;
}

.tl-gravityops_trustedlogin-auth h2 {
    line-height: 1.3;
    font-weight: 400;
    margin-bottom: 24px;
    text-align: left;
    color: #1d2327;
    margin-right: 8px;
    font-size: 18px;
}

.tl-gravityops_trustedlogin-auth h2 a {
    color: #2271b1;
    text-decoration: underline;
}

.tl-gravityops_trustedlogin-auth .tl-auth-details {
    margin-bottom: 30px;
}

.tl-gravityops_trustedlogin-auth .tl-auth-details > div {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
    color: #1d2327;
}

.tl-gravityops_trustedlogin-auth .tl-auth-details h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    position: relative;
    padding-left: 36px;
    min-height: 24px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    color: #1A1429;
    white-space: nowrap;
}

.tl-gravityops_trustedlogin-auth .tl-auth-details h2 .dashicons {
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-right: 5px;
    color: #975BE5;
    flex-shrink: 0;
}

.dashicons {
    margin-right: 8px;
}

strong {
    font-size: 18px;
    white-space: nowrap;
}

small {
    display: block;
    font-size: 14px;
    line-height: 1.2;
    margin-top: 4px;
    white-space: nowrap;
    text-align: inherit;
}

.tl-gravityops_trustedlogin-auth .tl-auth-details h2 small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #5B5670;
    margin-top: 0;
    padding-left: 36px;
}

/* Include message toggle */
.tl-gravityops_trustedlogin-toggle {
    color: #1A1429;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    text-decoration: none !important;
}
.tl-gravityops_trustedlogin-toggle:hover {
    color: #975BE5;
    text-decoration: none !important;
}

/* Site Health checkbox */
.tl-gravityops_trustedlogin-auth__debug {
    margin-top: 10px;
    margin-left: 0;
}
.tl-gravityops_trustedlogin-auth__debug p {
    margin: 0;
}
.tl-gravityops_trustedlogin-auth__debug label {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 14px;
    font-weight: 500;
    color: #5B5670;
}
.tl-gravityops_trustedlogin-auth__debug input[type="checkbox"] {
    margin-right: 5px;
    width: 16px;
    height: 16px;
}

.tl-gravityops_trustedlogin-auth .button-primary {
    background: #975BE5;
    border-color: #975BE5;
    padding: 12px 24px;
    height: auto;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    text-align: center;
    border-radius: 8px;
    box-shadow: none;
    margin-top: 20px;
    letter-spacing: 0.2px;
}

.tl-gravityops_trustedlogin-auth .button-primary:hover,
.tl-gravityops_trustedlogin-auth .button-primary:focus {
    background: #7F3FD6;
    border-color: #7F3FD6;
}

.tl-gravityops_trustedlogin-auth .tl-gravityops_trustedlogin-auth__secured_by {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
    text-align: center;
    font-size: 14px;
    color: #50575e;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tl-gravityops_trustedlogin-auth .tl-gravityops_trustedlogin-auth__footer {
    margin-top: 24px;
    text-align: center;
}

.tl-gravityops_trustedlogin-auth .tl-gravityops_trustedlogin-vendor-support-links {
    font-size: 14px;
    color: #50575e;
}

.tl-gravityops_trustedlogin-auth .tl-gravityops_trustedlogin-vendor-support-links a {
    color: #2271b1;
    text-decoration: none;
}

.tl-gravityops_trustedlogin-auth .tl-gravityops_trustedlogin-vendor-support-links a:hover {
    text-decoration: underline;
}

/* Access Key & Copy Button */
.tl-gravityops_trustedlogin-auth__accesskey {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.tl-gravityops_trustedlogin-auth__accesskey h3 {
    margin-bottom: 10px;
}

.tl-gravityops_trustedlogin-auth__accesskey_wrapper {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    align-items: stretch;
}

.tl-gravityops_trustedlogin-auth__accesskey_field {
    flex: 1;
    height: 44px !important;
    font-family: monospace;
    font-size: 14px !important;
    padding: 0 12px !important;
    border-radius: 6px !important;
}

.tl-gravityops_trustedlogin-auth__accesskey_copy {
    height: 44px !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600 !important;
    border-radius: 6px !important;
    min-width: 100px;
    background: #f6f7f7 !important;
}

.tl-gravityops_trustedlogin-auth__accesskey_copy::before {
    content: "\f105";
    font-family: dashicons, serif;
    font-size: 20px;
}

.tl-gravityops_trustedlogin-auth__accesskey_copy span {
    display: inline-block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    margin: 0 !important;
    overflow: visible !important;
}

.tl-gravityops_trustedlogin-auth__copied {
    background: #46b450 !important;
    color: white !important;
    border-color: #46b450 !important;
}

.tl-gravityops_trustedlogin-auth__copied::before {
    content: "\f147"; /* dashicons-yes */
}

#tl-gravityops_trustedlogin-access-key {
    width: 100%;
}

#tl-gravityops_trustedlogin-copy {
    margin-top: 0;
}

/* TrustedLogin Logo Styles */
.trustedlogin-logo-medium {
    display: inline-block;
    vertical-align: middle;
    height: 24px;
    width: 20px;
    background: transparent url("data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e%3csvg enable-background='new 0 0 139.3 220.7' version='1.1' viewBox='0 0 139.3 220.7' xml:space='preserve' xmlns='http://www.w3.org/2000/svg'%3e%3cstyle type='text/css'%3e .st0%7bfill:%231099D6%3b%7d .st1%7bfill:%231B2B59%3b%7d .st2%7bfill:white%3b%7d%3c/style%3e%3cpath class='st0' d='M70.7%2c0C44.1%2c0%2c22.5%2c21.6%2c22.5%2c48.1V88h20.6V48.1c0-15.2%2c12.3-27.5%2c27.5-27.5c15.1%2c0%2c27.5%2c12.3%2c27.5%2c27.5V88 h20.6V48.1C118.8%2c21.6%2c97.2%2c0%2c70.7%2c0z'/%3e%3cpath class='st1' d='m70.7 75.3c-38.5 0-69.7 4.9-69.7 10.8v79.8c0 38.5 47.5 54.8 69.7 54.8s69.7-16.3 69.7-54.8v-79.8c-0.1-5.9-31.3-10.8-69.7-10.8z'/%3e%3cpath class='st2' d='m70.7 95.6c-23 0-42.5 15.3-48.9 36.2h14.8c5.8-13.1 18.9-22.3 34.1-22.3 20.5 0 37.2 16.7 37.2 37.2s-16.7 37.2-37.2 37.2c-15.2 0-28.3-9.2-34.1-22.3h-14.8c6.4 20.9 25.9 36.2 48.9 36.2 28.2 0 51.1-22.9 51.1-51.1-0.1-28.2-23-51.1-51.1-51.1z'/%3e%3cpath class='st2' d='m90.3 144.3l-28.4-16.3c-2.2-1.3-4-0.2-4 2.3v9.8h-56.9v13h56.9v9.8c0 2.5 1.8 3.6 4 2.3l28.3-16.4c2.3-1.1 2.3-3.2 0.1-4.5z'/%3e%3c/svg%3e") no-repeat center center;
    background-size: contain;
}

a.button.button-hero.authlink.button-primary.tl-client-grant-button.button-trustedlogin-gravityops_trustedlogin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Or use padding/margin on the children */
}