.gatekeeper-form {
    max-width: 420px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 16px;
    position: relative;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gatekeeper-form--inline {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 20px 24px;
}

.gatekeeper-form__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.gatekeeper-form__icon {
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.gatekeeper-form__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.gatekeeper-form__description {
    margin: 0 0 20px;
    color: #4b5563;
    font-size: 15px;
}

.gatekeeper-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    flex: 1;
}

.gatekeeper-field__label {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.gatekeeper-field input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
}

.gatekeeper-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.gatekeeper-submit {
    width: auto;
    min-width: 140px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 20px rgba(79, 70, 229, 0.25);
}

.gatekeeper-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 24px rgba(79, 70, 229, 0.28);
}

.gatekeeper-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: none;
}

.gatekeeper-submit .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: gatekeeper-spin 0.8s linear infinite;
}

.gatekeeper-form.is-loading .gatekeeper-submit .spinner {
    display: inline-flex;
}

.gatekeeper-form.is-loading .gatekeeper-submit .label {
    opacity: 0.6;
}

.gatekeeper-feedback {
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    color: #047857;
    font-weight: 500;
}

.gatekeeper-feedback.is-error {
    color: #dc2626;
}

.gatekeeper-form--success {
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.gatekeeper-form--error {
    animation: gatekeeper-shake 0.4s ease;
}

/* Theme variations */
.gatekeeper-form--minimal {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.gatekeeper-form--minimal .gatekeeper-submit {
    background: #111827;
    box-shadow: none;
}

.gatekeeper-form--glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.gatekeeper-form--glass .gatekeeper-submit {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.gatekeeper-form--dark {
    background: #111827;
    color: #f9fafb;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.gatekeeper-form--dark .gatekeeper-field__label {
    color: #e5e7eb;
}

.gatekeeper-form--dark .gatekeeper-field input {
    background: rgba(17, 24, 39, 0.9);
    color: #f9fafb;
    border-color: rgba(59, 130, 246, 0.4);
}

.gatekeeper-form--dark .gatekeeper-submit {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
}

.gatekeeper-form--dark .gatekeeper-feedback {
    color: #34d399;
}

/* Inline layout */
.gatekeeper-form--inline .gatekeeper-field {
    margin-bottom: 0;
}

.gatekeeper-form--inline .gatekeeper-submit {
    margin-bottom: 18px;
}

/* Animations */
@keyframes gatekeeper-spin {
    to {
        transform: rotate(1turn);
    }
}

@keyframes gatekeeper-shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

/* Access Denied Page Styles */
.gatekeeper-access-denied {
    padding: 60px 20px;
    text-align: center;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gatekeeper-access-denied .container {
    max-width: 600px;
    margin: 0 auto;
}

.gatekeeper-access-denied h1 {
    font-size: 2.5em;
    color: #dc2626;
    margin-bottom: 20px;
    font-weight: 700;
}

.gatekeeper-access-denied .message {
    font-size: 1.1em;
    color: #4b5563;
    margin-bottom: 30px;
    line-height: 1.6;
}

.gatekeeper-access-denied .login-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.gatekeeper-access-denied .login-form h2 {
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.3em;
}

.gatekeeper-access-denied #gatekeeper_loginform {
    text-align: left;
}

.gatekeeper-access-denied #gatekeeper_loginform p {
    margin-bottom: 15px;
}

.gatekeeper-access-denied #gatekeeper_loginform label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.gatekeeper-access-denied #gatekeeper_loginform input[type="text"],
.gatekeeper-access-denied #gatekeeper_loginform input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gatekeeper-access-denied #gatekeeper_loginform input[type="text"]:focus,
.gatekeeper-access-denied #gatekeeper_loginform input[type="password"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gatekeeper-access-denied #gatekeeper_loginform input[type="submit"] {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    width: 100%;
}

.gatekeeper-access-denied #gatekeeper_loginform input[type="submit"]:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.gatekeeper-access-denied #gatekeeper_loginform .forgetmenot {
    margin: 15px 0;
}

.gatekeeper-access-denied #gatekeeper_loginform .forgetmenot input {
    margin-right: 8px;
}

/* Maintenance Mode Styles */
.gatekeeper-maintenance {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.gatekeeper-maintenance .content {
    max-width: 500px;
}

.gatekeeper-maintenance h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
}

.gatekeeper-maintenance p {
    font-size: 1.1em;
    opacity: 0.9;
    line-height: 1.6;
}

/* Security Status Widget */
.gatekeeper-security-status {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.gatekeeper-security-status h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1f2937;
    font-size: 1.1em;
}

.gatekeeper-security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.gatekeeper-security-item:last-child {
    border-bottom: none;
}

.gatekeeper-security-label {
    font-weight: 500;
    color: #374151;
}

.gatekeeper-security-value {
    font-weight: 600;
}

.gatekeeper-security-value.enabled {
    color: #059669;
}

.gatekeeper-security-value.disabled {
    color: #dc2626;
}

.gatekeeper-security-value.warning {
    color: #d97706;
}

@media (prefers-reduced-motion: reduce) {
    .gatekeeper-submit,
    .gatekeeper-field input,
    .gatekeeper-form,
    .gatekeeper-access-denied #gatekeeper_loginform input {
        transition: none;
    }

    .gatekeeper-submit .spinner,
    .gatekeeper-form--error {
        animation: none;
    }
}
