.dialog-box {
    position: relative;
}
.captcha-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
/* Dialog box for login and captcha */
.dialog-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 32px 32px 24px 32px;
    width: 400px;
    max-width: 95vw;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.form-fields label {
    font-size: 1rem;
    color: #555;
    margin-bottom: 2px;
}
.form-fields input[type="text"],
.form-fields input[type="password"] {
    padding: 8px 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    margin-bottom: 8px;
    background: #f7f7f7;
    transition: border-color 0.2s;
}
.form-fields input[type="text"]:focus,
.form-fields input[type="password"]:focus {
    border-color: #4285f4;
}
.submit-btn {
    width: 100%;
    padding: 0.7rem 0;
    font-size: 1.1rem;
    background: #4285f4;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 28px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(66,133,244,0.08);
    transition: background 0.2s;
}
.submit-btn:hover {
    background: #3367d6;
}
.derivation-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    width: 100px;
    height: 100px;
    min-height: unset;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 4px;
    text-align: center;
    word-break: break-word;
    box-sizing: border-box;
    overflow: hidden;
}
.derivation-box.selected {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px #4285f433;
    background: #e3f2fd;
}
#mathOptions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.math-option {
    background: #fff;
    border: 2px solid #4285f4;
    color: #4285f4;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.math-option:hover {
    background: #4285f4;
    color: #fff;
}
.math-challenge {
    margin-top: 16px;
    background: #f9f9f9;
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.math-challenge .derivation {
    font-family: 'Roboto Mono', monospace;
    color: #333;
    margin: 8px 0 0 0;
    font-size: 1rem;
}

body {
    font-family: Roboto, Arial, sans-serif;
    background: #e9ecef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.captcha-container {
    background: #fff;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    width: 370px;
    text-align: left;
    overflow: hidden;
}

.captcha-header {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    padding: 16px 20px 8px 20px;
    border-bottom: 1px solid #eee;
}
.captcha-logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}
.captcha-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #555;
}
.captcha-instructions {
    padding: 10px 20px 0 20px;
    font-size: 1rem;
    color: #333;
}
.captcha-task {
    display: block;
    margin-bottom: 4px;
}
.captcha-help {
    font-size: 0.9rem;
    color: #888;
}
.captcha-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 6px;
    padding: 16px 20px 0 20px;
}
.captcha-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #fafafa;
}
.captcha-img.selected {
    border-color: #4285f4;
    box-shadow: 0 0 0 2px #4285f433;
}
.captcha-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}
#verifyBtn {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    border: none;
    background: #4285f4;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-left: 12px;
}
.captcha-reload {
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    margin-right: 12px;
    transition: color 0.2s;
}
.captcha-reload:hover {
    color: #4285f4;
}
#result {
    font-weight: bold;
    color: #d32f2f;
    margin-left: auto;
    font-size: 1rem;
}
.recaptcha-checkbox {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 24px 14px 18px;
    min-width: 280px;
    min-height: 60px;
    cursor: pointer;
    position: relative;
    border: 1px solid #e0e0e0;
}
.recaptcha-checkbox-border {
    width: 28px;
    height: 28px;
    border: 2px solid #c1c1c1;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    transition: border-color 0.2s;
}
.recaptcha-checkbox-label {
    font-size: 1.1rem;
    color: #333;
    font-family: Roboto, Arial, sans-serif;
}
.recaptcha-checkbox-logo {
    position: absolute;
    right: 18px;
    bottom: 10px;
    display: flex;
    align-items: center;
}
.recaptcha-checkbox-check {
    display: flex;
    align-items: center;
    justify-content: center;
}
.recaptcha-checkbox.checked .recaptcha-checkbox-border {
    border-color: #4285f4;
    background: #e3f2fd;
}
.recaptcha-checkbox.checked .recaptcha-checkbox-check {
    display: flex !important;
}
