/* Form Container */
.subscription-system-form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 35px;
    background-color: var(--ss-surface);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(24, 38, 32, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.subscription-system-form-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--ss-primary);
}

.subscription-system-form-container:hover {
    box-shadow: 0 12px 35px rgba(24, 38, 32, 0.14);
    transform: translateY(-3px);
}

/* Form Header */
.subscription-system-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ss-border);
}

.subscription-system-form-header h2 {
    font-size: 28px;
    color: var(--ss-ink);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subscription-system-form-header p {
    color: var(--ss-muted);
    font-size: 16px;
    line-height: 1.5;
}

/* Form Styles */
.subscription-system-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-row {
    margin-bottom: 8px;
    width: 100%;
}

.form-group {
    width: 100%;
    position: relative;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--ss-body);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--ss-border);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: var(--ss-bg);
    box-sizing: border-box;
    height: auto;
    line-height: normal;
}

.form-control:focus {
    outline: none;
    border-color: var(--ss-primary);
    box-shadow: 0 0 0 3px var(--ss-primary-tint);
    background-color: var(--ss-surface);
}

.form-group.has-error .form-control {
    border-color: var(--ss-danger);
    background-color: var(--ss-danger-tint);
}

.form-group.has-error .error-message {
    color: var(--ss-danger);
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Remember Me Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.remember-me input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid var(--ss-border);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--ss-surface);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remember-me input[type="checkbox"]:checked {
    background-color: var(--ss-primary);
    border-color: var(--ss-primary);
}

.remember-me input[type="checkbox"]:checked:after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-me label {
    margin-bottom: 0;
    font-size: 14px;
    color: var(--ss-body);
    cursor: pointer;
}

/* Submit Button */
.subscription-system-submit-btn {
    background: var(--ss-primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--ss-shadow);
    margin-top: 10px;
}

.subscription-system-submit-btn:hover {
    background: var(--ss-primary-dark);
    box-shadow: 0 6px 15px rgba(24, 38, 32, 0.18);
    transform: translateY(-2px);
}

.subscription-system-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(24, 38, 32, 0.15);
}

.subscription-system-submit-btn:disabled {
    background: var(--ss-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Messages */
.subscription-system-message-container {
    margin-bottom: 25px;
}

.subscription-system-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    padding-left: 45px;
    line-height: 1.5;
    font-size: 14px;
}

.subscription-system-message:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

.subscription-system-message.success {
    background-color: var(--ss-success-tint);
    color: var(--ss-success);
    border-left: 4px solid var(--ss-success);
}

.subscription-system-message.error {
    background-color: var(--ss-danger-tint);
    color: var(--ss-danger);
    border-left: 4px solid var(--ss-danger);
}

.subscription-system-message.info {
    background-color: var(--ss-primary-tint);
    color: var(--ss-primary-dark);
    border-left: 4px solid var(--ss-primary);
}

.subscription-system-message.success:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231D6E8C"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>');
}

.subscription-system-message.error:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23A83232"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>');
}

.subscription-system-message.info:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23164536"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
}

/* Links */
.subscription-system-form-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: var(--ss-muted);
    padding-top: 20px;
    border-top: 1px solid var(--ss-border);
}

.subscription-system-form-footer p {
    margin: 8px 0;
}

.subscription-system-form a {
    color: var(--ss-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.subscription-system-form a:hover {
    color: var(--ss-primary-dark);
}

.subscription-system-form a:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--ss-primary-dark);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.subscription-system-form a:hover:after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Password Field with Toggle */
.password-field-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--ss-muted);
    font-size: 16px;
    z-index: 10;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: var(--ss-primary);
}

/* Form Field Focus Animation */
.form-control:focus + .field-icon {
    color: var(--ss-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .subscription-system-form-container {
        padding: 25px 20px;
        margin: 20px auto;
        border-radius: 8px;
    }

    .subscription-system-form-header h2 {
        font-size: 22px;
    }

    .subscription-system-form-header p {
        font-size: 14px;
    }

    .form-control {
        padding: 12px 14px;
    }

    .subscription-system-submit-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* Animation for form appearance */
@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscription-system-form-container {
    animation: formFadeIn 0.5s ease-out forwards;
}

/* Field Focus Effect */
.form-group {
    position: relative;
    margin-bottom: 5px;
}

.form-control:focus {
    border-color: var(--ss-primary);
}

/* Form validation styling */
.form-control:invalid:not(:placeholder-shown) {
    border-color: var(--ss-danger);
}

.form-control:valid:not(:placeholder-shown) {
    border-color: var(--ss-success);
}

/* Optional: Add icons to form fields */
.field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ss-muted);
    transition: all 0.3s ease;
}

.has-icon .form-control {
    padding-left: 40px;
}

/* ---------------------------------------------------------------
 * Premium polish pass — login / register / password reset
 *
 * These rules come last on purpose: they refine the base styles above
 * rather than duplicating them, so there is still one place per
 * property that can win.
 * --------------------------------------------------------------- */

.subscription-system-form-container {
    max-width: 460px;
    padding: 40px 38px 34px;
    border: 1px solid var(--ss-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(24, 38, 32, .04), 0 12px 32px -12px rgba(24, 38, 32, .18);
}

/* The accent rule reads as a deliberate brand mark, not a stray bar. */
.subscription-system-form-container:before {
    height: 3px;
    background: var(--ss-primary);
}

/* Hover-lifting a form is distracting while someone is typing in it. */
.subscription-system-form-container:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(24, 38, 32, .04), 0 12px 32px -12px rgba(24, 38, 32, .18);
}

.subscription-system-form-header {
    margin-bottom: 26px;
    padding-bottom: 0;
    border-bottom: none;
    text-align: left;
}

.subscription-system-form-header h2 {
    font-size: 25px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.subscription-system-form-header p {
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0;
}

.subscription-system-form {
    gap: 0;
}

.subscription-system-form .form-row {
    margin-bottom: 0;
}

.subscription-system-form .form-group {
    margin-bottom: 18px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--ss-ink);
    margin-bottom: 7px;
}

.form-control {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 10px;
    background-color: var(--ss-surface);
}

.form-control::placeholder {
    color: var(--ss-muted);
}

.form-control:hover:not(:focus) {
    border-color: var(--ss-muted);
}

.form-control:focus {
    box-shadow: 0 0 0 3px var(--ss-primary-tint);
}

/* Don't flag a field as invalid purely because it's mid-typing. */
.form-control:invalid:not(:placeholder-shown),
.form-control:valid:not(:placeholder-shown) {
    border-color: var(--ss-border);
}

.form-group.has-error .form-control {
    border-color: var(--ss-danger);
}

.password-field-container .form-control {
    padding-right: 46px;
}

.password-toggle {
    right: 12px;
    opacity: .6;
    font-size: 15px;
    line-height: 1;
}

.password-toggle:hover {
    opacity: 1;
}

.remember-me {
    margin: 2px 0 22px;
}

.remember-me label {
    font-size: 13.5px;
    color: var(--ss-body);
}

.subscription-system-submit-btn {
    padding: 13px 20px;
    font-size: 14.5px;
    letter-spacing: .04em;
    border-radius: 10px;
    margin-top: 0;
    box-shadow: none;
}

.subscription-system-submit-btn:hover {
    transform: none;
    box-shadow: 0 6px 16px -6px rgba(24, 38, 32, .5);
}

.subscription-system-submit-btn:focus-visible {
    outline: 2px solid var(--ss-primary);
    outline-offset: 2px;
}

.subscription-system-form-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--ss-border);
    font-size: 13.5px;
}

.subscription-system-form-footer p {
    margin: 6px 0;
}

/* The underline-grow effect fought the footer's own layout; a plain,
 * predictable link reads better here. */
.subscription-system-form a:after {
    display: none;
}

.subscription-system-form a {
    font-weight: 600;
}

.subscription-system-form a:hover {
    text-decoration: underline;
}

.subscription-system-message {
    border-radius: 10px;
    font-size: 13.5px;
}

@media (max-width: 520px) {
    .subscription-system-form-container {
        padding: 30px 22px 26px;
        border-radius: 12px;
        margin: 16px auto;
    }

    .subscription-system-form-header h2 {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .subscription-system-form-container {
        animation: none;
    }
}
